activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tab...@apache.org
Subject activemq git commit: https://issues.apache.org/jira/browse/AMQ-5599
Date Tue, 02 Jun 2015 15:37:19 GMT
Repository: activemq
Updated Branches:
  refs/heads/master 73e8d1098 -> 35b82e5f9


https://issues.apache.org/jira/browse/AMQ-5599

Ensure that persistence adapter start is not missed to avoid infinite
wait for it.  

Project: http://git-wip-us.apache.org/repos/asf/activemq/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq/commit/35b82e5f
Tree: http://git-wip-us.apache.org/repos/asf/activemq/tree/35b82e5f
Diff: http://git-wip-us.apache.org/repos/asf/activemq/diff/35b82e5f

Branch: refs/heads/master
Commit: 35b82e5f93b679629dac74d6ee83bcb180e2d9e4
Parents: 73e8d10
Author: Timothy Bish <tabish121@gmail.com>
Authored: Tue Jun 2 11:36:47 2015 -0400
Committer: Timothy Bish <tabish121@gmail.com>
Committed: Tue Jun 2 11:36:47 2015 -0400

----------------------------------------------------------------------
 .../java/org/apache/activemq/broker/BrokerService.java | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq/blob/35b82e5f/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
----------------------------------------------------------------------
diff --git a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
index 3eda490..a2a04a0 100644
--- a/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
+++ b/activemq-broker/src/main/java/org/apache/activemq/broker/BrokerService.java
@@ -240,7 +240,7 @@ public class BrokerService implements Service {
     private long offlineDurableSubscriberTaskSchedule = 300000;
     private DestinationFilter virtualConsumerDestinationFilter;
 
-    private final Object persistenceAdapterLock = new Object();
+    private final AtomicBoolean persistenceAdapterStarted = new AtomicBoolean(false);
     private Throwable startException = null;
     private boolean startAsync = false;
     private Date startDate;
@@ -630,8 +630,9 @@ public class BrokerService implements Service {
                     } catch (Throwable e) {
                         startException = e;
                     } finally {
-                        synchronized (persistenceAdapterLock) {
-                            persistenceAdapterLock.notifyAll();
+                        synchronized (persistenceAdapterStarted) {
+                            persistenceAdapterStarted.set(true);
+                            persistenceAdapterStarted.notifyAll();
                         }
                     }
                 }
@@ -669,8 +670,10 @@ public class BrokerService implements Service {
                 @Override
                 public void run() {
                     try {
-                        synchronized (persistenceAdapterLock) {
-                            persistenceAdapterLock.wait();
+                        synchronized (persistenceAdapterStarted) {
+                            if (!persistenceAdapterStarted.get()) {
+                                persistenceAdapterStarted.wait();
+                            }
                         }
                         doStartBroker();
                     } catch (Throwable t) {


Mime
View raw message