Repository: activemq-artemis
Updated Branches:
  refs/heads/master b9a9ca628 -> 308c79016


ARTEMIS-350 - add timeout to avoid deadlock

https://issues.apache.org/jira/browse/ARTEMIS-350


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

Branch: refs/heads/master
Commit: a24dc5b61aec4c0bf71173056915a09187c216ea
Parents: b9a9ca6
Author: Andy Taylor <andy.tayl...@gmail.com>
Authored: Thu Jan 21 10:02:24 2016 +0000
Committer: Andy Taylor <andy.tayl...@gmail.com>
Committed: Thu Jan 21 10:02:24 2016 +0000

----------------------------------------------------------------------
 .../activemq/artemis/core/replication/ReplicationManager.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/a24dc5b6/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
index 3c2d236..3e66c09 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/replication/ReplicationManager.java
@@ -25,6 +25,7 @@ import java.util.Map;
 import java.util.Queue;
 import java.util.Set;
 import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.api.core.ActiveMQBuffer;
 import org.apache.activemq.artemis.api.core.ActiveMQException;
@@ -343,7 +344,8 @@ public final class ReplicationManager implements 
ActiveMQComponent, ReadyListene
             if (!replicatingChannel.getConnection().isWritable(this)) {
                latch.countUp();
                try {
-                  latch.await();
+                  //don't wait for ever as this may hang tests etc, we've 
probably been closed anyway
+                  latch.await(5, TimeUnit.SECONDS);
                }
                catch (InterruptedException e) {
                   throw new ActiveMQInterruptedException(e);

Reply via email to