activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r584800 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Date Mon, 15 Oct 2007 14:50:10 GMT
Author: chirino
Date: Mon Oct 15 07:50:09 2007
New Revision: 584800

URL: http://svn.apache.org/viewvc?rev=584800&view=rev
Log:
Fix for a failover transport deadlock that could occur if the transport is stopped at the
same time a failure occurs.

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java?rev=584800&r1=584799&r2=584800&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/transport/failover/FailoverTransport.java
Mon Oct 15 07:50:09 2007
@@ -258,6 +258,7 @@
     }
 
     public void stop() throws Exception {
+        Transport transportToStop=null;
         synchronized (reconnectMutex) {
             LOG.debug("Stopped.");
             if (!started) {
@@ -267,7 +268,7 @@
             disposed = true;
 
             if (connectedTransport != null) {
-                connectedTransport.stop();
+                transportToStop = connectedTransport;
                 connectedTransport = null;
             }
             reconnectMutex.notifyAll();
@@ -276,6 +277,9 @@
             sleepMutex.notifyAll();
         }
         reconnectTask.shutdown();
+        if( transportToStop!=null ) {
+            transportToStop.stop();
+        }
     }
 
     public long getInitialReconnectDelay() {



Mime
View raw message