ARTEMIS-350 Small improvement on the replication stop
This commit is contained in:
parent
b7f0d14b18
commit
68faa1d252
|
@ -263,14 +263,17 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene
|
||||||
if (!started) {
|
if (!started) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
replicatingChannel.getConnection().getTransportConnection().fireReady(true);
|
|
||||||
latch.setCount(0);
|
enabled = false;
|
||||||
|
|
||||||
|
// This is to avoid the write holding a lock while we are trying to close it
|
||||||
|
if (replicatingChannel != null) {
|
||||||
|
replicatingChannel.close();
|
||||||
|
replicatingChannel.getConnection().getTransportConnection().fireReady(true);
|
||||||
|
latch.setCount(0);
|
||||||
|
}
|
||||||
|
|
||||||
synchronized (replicationLock) {
|
synchronized (replicationLock) {
|
||||||
enabled = false;
|
|
||||||
if (replicatingChannel != null) {
|
|
||||||
replicatingChannel.close();
|
|
||||||
}
|
|
||||||
clearReplicationTokens();
|
clearReplicationTokens();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +281,6 @@ public final class ReplicationManager implements ActiveMQComponent, ReadyListene
|
||||||
if (toStop != null) {
|
if (toStop != null) {
|
||||||
toStop.removeFailureListener(failureListener);
|
toStop.removeFailureListener(failureListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
remotingConnection = null;
|
remotingConnection = null;
|
||||||
started = false;
|
started = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue