mirror of https://github.com/apache/activemq.git
Move the shutting down of the reconnectTask outside the reconnectMutex. The shutdown task may block indefinitely, while waiting for some other threads to finish iterating through the task. If the iterating thread needs to obtain the reconnectMutex (i.e. in doConnect), it won't be able to, since the shutdown task is still holding on to the lock causing a deadlock.
git-svn-id: https://svn.apache.org/repos/asf/incubator/activemq/trunk@379717 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
97f35c40ec
commit
83ab261e69
|
@ -283,8 +283,6 @@ public class FanoutTransport implements CompositeTransport {
|
||||||
started = false;
|
started = false;
|
||||||
disposed = true;
|
disposed = true;
|
||||||
|
|
||||||
reconnectTask.shutdown();
|
|
||||||
|
|
||||||
for (Iterator iter = transports.iterator(); iter.hasNext();) {
|
for (Iterator iter = transports.iterator(); iter.hasNext();) {
|
||||||
FanoutTransportHandler th = (FanoutTransportHandler) iter.next();
|
FanoutTransportHandler th = (FanoutTransportHandler) iter.next();
|
||||||
if( th.transport != null ) {
|
if( th.transport != null ) {
|
||||||
|
@ -295,6 +293,8 @@ public class FanoutTransport implements CompositeTransport {
|
||||||
log.debug("Stopped: "+this);
|
log.debug("Stopped: "+this);
|
||||||
ss.throwFirstException();
|
ss.throwFirstException();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
reconnectTask.shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
public long getInitialReconnectDelay() {
|
public long getInitialReconnectDelay() {
|
||||||
|
|
Loading…
Reference in New Issue