From 2c414b741749845a94b1b2b8eb09803852dbc9b1 Mon Sep 17 00:00:00 2001 From: Gary Tully Date: Mon, 1 Feb 2010 23:08:00 +0000 Subject: [PATCH] merge -c 833435 https://svn.apache.org/repos/asf/activemq/trunk - resolve intermittent failure of DiscoveryNetworkReconnectTest due to network timing issues git-svn-id: https://svn.apache.org/repos/asf/activemq/branches/activemq-5.3@905442 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/activemq/broker/jmx/ManagementContext.java | 7 ++++--- .../transport/discovery/DiscoveryNetworkReconnectTest.java | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java index 8db2911a19..7fb515ae07 100644 --- a/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java +++ b/activemq-core/src/main/java/org/apache/activemq/broker/jmx/ManagementContext.java @@ -45,7 +45,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; /** - * A Flow provides different dispatch policies within the NMR + * An abstraction over JMX mbean registration * * @org.apache.xbean.XBean * @version $Revision$ @@ -96,11 +96,12 @@ public class ManagementContext implements Service { try { JMXConnectorServer server = connectorServer; if (started.get() && server != null) { + LOG.debug("Starting JMXConnectorServer..."); connectorStarting.set(true); try { - server.start(); + server.start(); } finally { - connectorStarting.set(false); + connectorStarting.set(false); } LOG.info("JMX consoles can connect to " + server.getAddress()); } diff --git a/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java b/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java index de556b68af..32c8b26f7d 100755 --- a/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java +++ b/activemq-core/src/test/java/org/apache/activemq/transport/discovery/DiscoveryNetworkReconnectTest.java @@ -202,8 +202,11 @@ public class DiscoveryNetworkReconnectTest { // wait for the inactivity timeout and network shutdown assertTrue("network connector mbean unregistered within 3 minute", mbeanUnregistered.tryAcquire(180, TimeUnit.SECONDS)); + // whack all connections + proxy.close(); + // let a reconnect succeed - proxy.goOn(); + proxy.reopen(); } } }