Fix for a failover transport deadlock that could occur if the transport is stopped at the same time a failure occurs.

git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@584800 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Hiram R. Chirino 2007-10-15 14:50:09 +00:00
parent 67e5952dd1
commit 487e694152
1 changed files with 5 additions and 1 deletions

View File

@ -258,6 +258,7 @@ public class FailoverTransport implements CompositeTransport {
}
public void stop() throws Exception {
Transport transportToStop=null;
synchronized (reconnectMutex) {
LOG.debug("Stopped.");
if (!started) {
@ -267,7 +268,7 @@ public class FailoverTransport implements CompositeTransport {
disposed = true;
if (connectedTransport != null) {
connectedTransport.stop();
transportToStop = connectedTransport;
connectedTransport = null;
}
reconnectMutex.notifyAll();
@ -276,6 +277,9 @@ public class FailoverTransport implements CompositeTransport {
sleepMutex.notifyAll();
}
reconnectTask.shutdown();
if( transportToStop!=null ) {
transportToStop.stop();
}
}
public long getInitialReconnectDelay() {