activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r637962 - /activemq/trunk/activemq-core/src/main/java/org/apache/activemq/broker/TransportConnection.java
Date Mon, 17 Mar 2008 16:34:37 GMT
Author: chirino
Date: Mon Mar 17 09:34:34 2008
New Revision: 637962

URL: http://svn.apache.org/viewvc?rev=637962&view=rev
Log:
Don't timeout trying to aquire the service write lock.  Timing out can cause to improper shutdown.

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=637962&r1=637961&r2=637962&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
Mon Mar 17 09:34:34 2008
@@ -895,24 +895,14 @@
             new Thread("ActiveMQ Transport Stopper: "+ transport.getRemoteAddress()) {
                 @Override
                 public void run() {
-                    boolean locked = false;
-                    // make sure we are not servicing client requests while we are shutting
down.
-                    try {
-                        //we could be waiting a long time if the network has gone - so only
wait 1 second
-                        locked =  serviceLock.writeLock().tryLock(1,TimeUnit.SECONDS);
-                    } catch (InterruptedException e) {
-                       LOG.debug("Try get writeLock interrupted ",e);
-                    }
+                    serviceLock.writeLock().lock();
                     try {
                         doStop();
                     } catch (Throwable e) {
-                        LOG.info("Error occured while shutting down a connection to '" +
transport.getRemoteAddress()+ "': "+e);
                         LOG.debug("Error occured while shutting down a connection to '" +
transport.getRemoteAddress()+ "': ", e);
                     } finally {
                         stopped.countDown();
-                        if (locked) {
-                            serviceLock.writeLock().unlock();
-                        }
+                        serviceLock.writeLock().unlock();
                     }
                 }
             }.start();



Mime
View raw message