mirror of https://github.com/apache/activemq.git
release the connection even if broker communication fails
(cherry picked from commit 934f3cea7e
)
This commit is contained in:
parent
81ef5efdc7
commit
d9a79d172b
|
@ -678,6 +678,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
|
||||
this.activeTempDestinations.clear();
|
||||
|
||||
try {
|
||||
if (isConnectionInfoSentToBroker) {
|
||||
// If we announced ourselves to the broker.. Try to let the broker
|
||||
// know that the connection is being shutdown.
|
||||
|
@ -694,7 +695,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
}
|
||||
doAsyncSendPacket(new ShutdownInfo());
|
||||
}
|
||||
|
||||
} finally { // release anyway even if previous communication fails
|
||||
started.set(false);
|
||||
|
||||
// TODO if we move the TaskRunnerFactory to the connection
|
||||
|
@ -708,6 +709,7 @@ public class ActiveMQConnection implements Connection, TopicConnection, QueueCon
|
|||
closing.set(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
if (executor != null) {
|
||||
|
|
Loading…
Reference in New Issue