mirror of https://github.com/apache/activemq.git
don't wait for ever when stopping the connection on a blocked write
git-svn-id: https://svn.apache.org/repos/asf/activemq/trunk@636419 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
84792bafed
commit
f67415d879
|
@ -890,7 +890,12 @@ public class TransportConnection implements Connection, Task, CommandVisitor {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
// make sure we are not servicing client requests while we are shutting down.
|
// make sure we are not servicing client requests while we are shutting down.
|
||||||
serviceLock.writeLock().lock();
|
try {
|
||||||
|
//we could be waiting a long time if the network has gone - so only wait 1 second
|
||||||
|
serviceLock.writeLock().tryLock(1,TimeUnit.SECONDS);
|
||||||
|
} catch (InterruptedException e) {
|
||||||
|
LOG.debug("Try get writeLock interrupted ",e);
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
doStop();
|
doStop();
|
||||||
} catch (Throwable e) {
|
} catch (Throwable e) {
|
||||||
|
|
Loading…
Reference in New Issue