activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gtu...@apache.org
Subject svn commit: r1186258 - in /activemq/trunk/activemq-core/src: main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java
Date Wed, 19 Oct 2011 15:10:00 GMT
Author: gtully
Date: Wed Oct 19 15:09:59 2011
New Revision: 1186258

URL: http://svn.apache.org/viewvc?rev=1186258&view=rev
Log:
https://issues.apache.org/jira/browse/AMQ-3542 - remove duplicate bridge stop, could on occasion
beat another thread to the stop and cause a deadlock, resulting in intermittent failure to
restart a bridge

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
    activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java?rev=1186258&r1=1186257&r2=1186258&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/network/DiscoveryNetworkConnector.java
Wed Oct 19 15:09:59 2011
@@ -172,9 +172,6 @@ public class DiscoveryNetworkConnector e
             synchronized (bridges) {
                 bridge = bridges.remove(uri);
             }
-            if (bridge != null) {
-                ServiceSupport.dispose(bridge);
-            }
         }
     }
 

Modified: activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java?rev=1186258&r1=1186257&r2=1186258&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java
(original)
+++ activemq/trunk/activemq-core/src/test/java/org/apache/activemq/usecases/NetworkOfTwentyBrokersTest.java
Wed Oct 19 15:09:59 2011
@@ -27,6 +27,7 @@ import org.apache.activemq.broker.region
 import org.apache.activemq.command.BrokerInfo;
 import org.apache.activemq.network.NetworkConnector;
 import org.apache.activemq.util.ThreadTracker;
+import org.apache.activemq.util.Wait;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -178,9 +179,16 @@ public class NetworkOfTwentyBrokersTest 
     }
 
 
-    private void verifyPeerBrokerInfo(BrokerItem brokerItem, final int max) {
-        BrokerService broker = brokerItem.broker;
-        RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
+    private void verifyPeerBrokerInfo(BrokerItem brokerItem, final int max) throws Exception
{
+        final BrokerService broker = brokerItem.broker;
+        final RegionBroker regionBroker = (RegionBroker) broker.getRegionBroker();
+        Wait.waitFor(new Wait.Condition() {
+            @Override
+            public boolean isSatisified() throws Exception {
+                LOG.info("verify infos " + broker.getBrokerName() + ", len: " + regionBroker.getPeerBrokerInfos().length);
+                return max == regionBroker.getPeerBrokerInfos().length;
+            }
+         });
         LOG.info("verify infos " + broker.getBrokerName() + ", len: " + regionBroker.getPeerBrokerInfos().length);
         for (BrokerInfo info : regionBroker.getPeerBrokerInfos()) {
             LOG.info(info.getBrokerName());
@@ -188,7 +196,7 @@ public class NetworkOfTwentyBrokersTest 
         assertEquals(broker.getBrokerName(), max, regionBroker.getPeerBrokerInfos().length);
     }
 
-    private void verifyPeerBrokerInfos(final int max) {
+    private void verifyPeerBrokerInfos(final int max) throws Exception {
         Collection<BrokerItem> brokerList = brokers.values();
         for (Iterator<BrokerItem> i = brokerList.iterator(); i.hasNext();) {
             verifyPeerBrokerInfo(i.next(), max);



Mime
View raw message