activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hadr...@apache.org
Subject [5/8] activemq git commit: improve trace logging on failure and tidy up future - try to nail down intermittent duplex bridge half start
Date Thu, 18 Dec 2014 03:17:38 GMT
improve trace logging on failure and tidy up future - try to nail down intermittent duplex
bridge half start


Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/aeecf888
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/aeecf888
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/aeecf888

Branch: refs/heads/activemq-5.10.x
Commit: aeecf8880920981afeae24f47b0e1dfdf87e3e3a
Parents: a0af997
Author: gtully <gary.tully@gmail.com>
Authored: Thu Sep 18 22:40:04 2014 +0100
Committer: Hadrian Zbarcea <hadrian@apache.org>
Committed: Wed Dec 17 21:50:09 2014 -0500

----------------------------------------------------------------------
 .../network/DemandForwardingBridgeSupport.java         | 13 +++++++------
 1 file changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/aeecf888/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
index f61c5ac..7d334ac 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/network/DemandForwardingBridgeSupport.java
@@ -347,7 +347,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
         try {
             remoteBrokerInfo = futureRemoteBrokerInfo.get();
             if (remoteBrokerInfo == null) {
-                fireBridgeFailed();
+                fireBridgeFailed(new Throwable("remoteBrokerInfo is null"));
                 return;
             }
         } catch (Exception e) {
@@ -358,7 +358,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
         try {
             localBrokerInfo = futureLocalBrokerInfo.get();
             if (localBrokerInfo == null) {
-                fireBridgeFailed();
+                fireBridgeFailed(new Throwable("localBrokerInfo is null"));
                 return;
             }
 
@@ -592,7 +592,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
                     ServiceSupport.dispose(getControllingService());
                 }
             });
-            fireBridgeFailed();
+            fireBridgeFailed(error);
         }
     }
 
@@ -871,7 +871,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
                     ServiceSupport.dispose(getControllingService());
                 }
             });
-            fireBridgeFailed();
+            fireBridgeFailed(error);
         }
     }
 
@@ -1430,7 +1430,8 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
         this.networkBridgeListener = listener;
     }
 
-    private void fireBridgeFailed() {
+    private void fireBridgeFailed(Throwable reason) {
+        LOG.trace("fire bridge failed, listener: {}", this.networkBridgeListener, reason);
         NetworkBridgeListener l = this.networkBridgeListener;
         if (l != null && this.bridgeFailed.compareAndSet(false, true)) {
             l.bridgeFailed();
@@ -1596,7 +1597,7 @@ public abstract class DemandForwardingBridgeSupport implements NetworkBridge,
Br
 
         private final CountDownLatch slot = new CountDownLatch(1);
         private final AtomicBoolean disposed;
-        private BrokerInfo info = null;
+        private volatile BrokerInfo info = null;
 
         public FutureBrokerInfo(BrokerInfo info, AtomicBoolean disposed) {
             this.info = info;


Mime
View raw message