You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by ke...@apache.org on 2010/10/22 19:15:37 UTC

svn commit: r1026410 - /geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java

Author: kevan
Date: Fri Oct 22 17:15:36 2010
New Revision: 1026410

URL: http://svn.apache.org/viewvc?rev=1026410&view=rev
Log:
GERONIMO-5660 avoid potential ActiveMQ hang during shutdown when asyncStartup is used

Modified:
    geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java

Modified: geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java
URL: http://svn.apache.org/viewvc/geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java?rev=1026410&r1=1026409&r2=1026410&view=diff
==============================================================================
--- geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java (original)
+++ geronimo/server/branches/2.2/plugins/activemq/geronimo-activemq/src/main/java/org/apache/geronimo/activemq/BrokerServiceGBeanImpl.java Fri Oct 22 17:15:36 2010
@@ -140,6 +140,10 @@ public class BrokerServiceGBeanImpl impl
     public synchronized void doStop() throws Exception {
         if (asyncStartup) {
             active.set(false);
+            // ActiveMQ AMQPersistenceAdapter can hang, if we are still starting
+            if (asyncStarted.getCount() > 0) {
+                return;
+            }
         }
         brokerService.stop();
         brokerService.waitUntilStopped();
@@ -148,6 +152,10 @@ public class BrokerServiceGBeanImpl impl
     public synchronized void doFail() {
         if (asyncStartup) {
             active.set(false);
+            // ActiveMQ AMQPersistenceAdapter can hang, if we are still starting
+            if (asyncStarted.getCount() > 0) {
+                return;
+            }
         }        
         try {
             brokerService.stop();