make sure that if we have a replicator to wait for then we hold on to it in case it gets nulled out in between

This commit is contained in:
Axel Uhl
2015-03-30 21:43:28 +02:00
parent e75b2e1985
commit 980f18914f
@@ -179,10 +179,13 @@ public abstract class AbstractServerReplicationTestSetUp<ReplicableInterface ext
* original exception propagate */
logger.log(Level.SEVERE, "Exception trying to connect to initial load test servlet to STOP it", ex);
}
synchronized (replicaReplicator.getReplicator()) {
while (!replicaReplicator.getReplicator().isQueueEmptyOrStopped()) {
logger.info("Waiting for replication queue to drain...");
replicaReplicator.getReplicator().wait();
ReplicationReceiver replicaReplicatorReplicator = replicaReplicator.getReplicator();
if (replicaReplicatorReplicator != null) {
synchronized (replicaReplicatorReplicator) {
while (!replicaReplicatorReplicator.isQueueEmptyOrStopped()) {
logger.info("Waiting for replication queue to drain...");
replicaReplicatorReplicator.wait();
}
}
}
logger.info("Replication queue has been drained...");