diff --git a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java index 47fecc8ca2..a97f3818a6 100644 --- a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java +++ b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/protocol/core/impl/ChannelImpl.java @@ -643,6 +643,10 @@ public final class ChannelImpl implements Channel { unlock(); } closed = true; + // unblock any blocked call: + // don't move this one before closed = true, because + // unblocked calls need to check if (closed) to "gracefully" shutdown. + returnBlocking(); } @Override diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java index 97dcab5f78..db82925ff0 100644 --- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java +++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/BackupManager.java @@ -192,9 +192,9 @@ public class BackupManager implements ActiveMQComponent { private TransportConfiguration connector; protected long retryInterval; private ClusterManager clusterManager; - private boolean stopping = false; - private boolean announcingBackup; - private boolean backupAnnounced = false; + private volatile boolean stopping = false; + private volatile boolean announcingBackup; + private volatile boolean backupAnnounced = false; @Override public String toString() {