This commit is contained in:
Martyn Taylor 2016-01-21 10:23:06 +00:00
commit 308c790163
1 changed files with 3 additions and 1 deletions

View File

@ -25,6 +25,7 @@ import java.util.Map;
import java.util.Queue; import java.util.Queue;
import java.util.Set; import java.util.Set;
import java.util.concurrent.ConcurrentLinkedQueue; 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.ActiveMQBuffer;
import org.apache.activemq.artemis.api.core.ActiveMQException; import org.apache.activemq.artemis.api.core.ActiveMQException;
@ -343,7 +344,8 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene
if (!replicatingChannel.getConnection().isWritable(this)) { if (!replicatingChannel.getConnection().isWritable(this)) {
latch.countUp(); latch.countUp();
try { 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) { catch (InterruptedException e) {
throw new ActiveMQInterruptedException(e); throw new ActiveMQInterruptedException(e);