diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java index 0a06ee912c..41d1dd64dd 100755 --- a/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/InactivityMonitor.java @@ -246,7 +246,7 @@ public class InactivityMonitor extends TransportFilter { public void onException(IOException error) { closeDown(); - if (!failed.getAndSet(true)) { + if (!failed.compareAndSet(false,true)) { transportListener.onException(error); } }