ARTEMIS-4114 Avoiding deadlock during scale down

We will rely on existing tests for this change
This commit is contained in:
Clebert Suconic 2022-12-15 13:50:08 -05:00 committed by clebertsuconic
parent 11c26943fa
commit b565a8a7b9
1 changed files with 11 additions and 8 deletions

View File

@ -428,14 +428,17 @@ public class ClusterConnectionBridge extends BridgeImpl {
clusterConnection.removeRecord(targetNodeID);
if (scaleDown) {
try {
queue.deleteQueue(true);
queue.removeAddress();
} catch (ActiveMQAddressDoesNotExistException e) {
// ignore
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
executor.execute(() -> {
logger.debug("Scaling down queue {}", queue);
try {
queue.deleteQueue(true);
queue.removeAddress();
} catch (ActiveMQAddressDoesNotExistException e) {
logger.debug("ActiveMQAddressDoesNotExistException during scale down for queue {}", queue);
} catch (Exception e) {
logger.warn(e.getMessage(), e);
}
});
}
} else {
clusterConnection.disconnectRecord(targetNodeID);