Skip to content

Commit

Permalink
Use the simple election policy for singletons when in WF 8/9
Browse files Browse the repository at this point in the history
There is a bug (https://issues.jboss.org/browse/WFLY-5108) that can
cause non-deterministic election policies to result in an inconsistent
singleton state (multiple nodes running the singleton, or no nodes
running the singleton are both possible). This caused an intermittent
integ failure in Immutant's cluster tests. We're still using the random
election policy with WF10 - the Immutant tests should catch it if it
also has the same behavior.
  • Loading branch information
tobias committed Nov 6, 2015
1 parent 0e6f802 commit d172d0a
Showing 1 changed file with 7 additions and 1 deletion.
Expand Up @@ -111,8 +111,14 @@ private static Object electionPolicy() {
String className;
if (ASUtils.containerIsEAP()) {
className = "org.jboss.as.clustering.singleton.election.SimpleSingletonElectionPolicy";
} else if (ASUtils.containerIsWildFly10()) {
className = "org.wildfly.clustering.singleton.election.RandomSingletonElectionPolicy";
} else {
className = "org.projectodd.wunderboss.as.singletons.RandomSingletonElectionPolicy";
// non-deterministic election policies (in WF versions < 10) can cause multiple or no
// singletons to start in the cluster, since each node determines the master individually
// so we use the simple policy (which is deterministic) if we're not in WF10.
// see https://issues.jboss.org/browse/WFLY-5108
className = "org.wildfly.clustering.singleton.election.SimpleSingletonElectionPolicy";
}

try {
Expand Down

0 comments on commit d172d0a

Please sign in to comment.