You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2018/05/02 15:40:35 UTC
[5/6] activemq-artemis git commit: ARTEMIS-1842 make sure quorum vote
loops exits
ARTEMIS-1842 make sure quorum vote loops exits
Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/2de1e49e
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/2de1e49e
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/2de1e49e
Branch: refs/heads/master
Commit: 2de1e49e5f022bfccd2aea16e4831a679862c482
Parents: e8a1e43
Author: andytaylor <an...@gmail.com>
Authored: Wed May 2 11:39:13 2018 +0100
Committer: Clebert Suconic <cl...@apache.org>
Committed: Wed May 2 11:38:50 2018 -0400
----------------------------------------------------------------------
.../core/server/cluster/qourum/SharedNothingBackupQuorum.java | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2de1e49e/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
index d8f0d73..dd1248d 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
@@ -64,6 +64,8 @@ public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener
private final NetworkHealthCheck networkHealthCheck;
+ private boolean stopped = false;
+
/**
* This is a safety net in case the live sends the first {@link ReplicationLiveIsStoppingMessage}
* with code {@link org.apache.activemq.artemis.core.protocol.core.impl.wireformat.ReplicationLiveIsStoppingMessage.LiveStopping#STOP_CALLED} and crashes before sending the second with
@@ -266,6 +268,7 @@ public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener
* @param explicitSignal the state we want to set the quorum manager to return
*/
public synchronized void causeExit(BACKUP_ACTIVATION explicitSignal) {
+ stopped = true;
removeListener();
this.signal = explicitSignal;
latch.countDown();
@@ -287,7 +290,7 @@ public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener
int size = quorumSize == -1 ? quorumManager.getMaxClusterSize() : quorumSize;
synchronized (voteGuard) {
- while (!decision && voteAttempts++ < voteRetries) {
+ while (!stopped && voteAttempts++ < voteRetries) {
//the live is dead so lets vote for quorum
QuorumVoteServerConnect quorumVote = new QuorumVoteServerConnect(size, targetServerID);