You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ta...@apache.org on 2015/06/02 17:37:19 UTC
activemq git commit: https://issues.apache.org/jira/browse/AMQ-5599
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 <ta...@gmail.com>
Authored: Tue Jun 2 11:36:47 2015 -0400
Committer: Timothy Bish <ta...@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) {