activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rajdav...@apache.org
Subject svn commit: r636419 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Date Wed, 12 Mar 2008 17:04:54 GMT
Author: rajdavies
Date: Wed Mar 12 10:04:44 2008
New Revision: 636419

URL: http://svn.apache.org/viewvc?rev=636419&view=rev
Log:
don't wait for ever when stopping the connection on a blocked write

Modified:
    activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java

Modified: activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java?rev=636419&r1=636418&r2=636419&view=diff
==============================================================================
--- activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
(original)
+++ activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Wed Mar 12 10:04:44 2008
@@ -607,7 +607,7 @@
         if( wireFormatInfo!=null && wireFormatInfo.getVersion() <= 2 ) {
             info.setClientMaster(true);
         }
-
+        
         TransportConnectionState state;
 
         // Make sure 2 concurrent connections by the same ID only generate 1
@@ -890,7 +890,12 @@
                 @Override
                 public void run() {
                     // 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 {
                         doStop();
                     } catch (Throwable e) {



Mime
View raw message