ARTEMIS-217 fixing dead lock
https://issues.apache.org/jira/browse/ARTEMIS-217 fixing dead lock This is using a separate lock for notifications, this way we won't hold a lock while communicating on netty which was the issue here.
This commit is contained in:
parent
ab618d295d
commit
220e39ef1f
|
@ -816,7 +816,9 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (retry);
|
} while (retry);
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (topologyArrayGuard) {
|
||||||
// We always wait for the topology, as the server
|
// We always wait for the topology, as the server
|
||||||
// will send a single element if not cluster
|
// will send a single element if not cluster
|
||||||
// so clients can know the id of the server they are connected to
|
// so clients can know the id of the server they are connected to
|
||||||
|
@ -824,7 +826,7 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
||||||
while (!isClosed() && !receivedTopology && timeout > System.currentTimeMillis()) {
|
while (!isClosed() && !receivedTopology && timeout > System.currentTimeMillis()) {
|
||||||
// Now wait for the topology
|
// Now wait for the topology
|
||||||
try {
|
try {
|
||||||
wait(1000);
|
topologyArrayGuard.wait(1000);
|
||||||
}
|
}
|
||||||
catch (InterruptedException e) {
|
catch (InterruptedException e) {
|
||||||
throw new ActiveMQInterruptedException(e);
|
throw new ActiveMQInterruptedException(e);
|
||||||
|
@ -847,7 +849,6 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
||||||
|
|
||||||
return factory;
|
return factory;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isHA() {
|
public boolean isHA() {
|
||||||
|
@ -1410,10 +1411,10 @@ public final class ServerLocatorImpl implements ServerLocatorInternal, Discovery
|
||||||
updateArraysAndPairs();
|
updateArraysAndPairs();
|
||||||
|
|
||||||
if (last) {
|
if (last) {
|
||||||
synchronized (this) {
|
synchronized (topologyArrayGuard) {
|
||||||
receivedTopology = true;
|
receivedTopology = true;
|
||||||
// Notify if waiting on getting topology
|
// Notify if waiting on getting topology
|
||||||
notifyAll();
|
topologyArrayGuard.notifyAll();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue