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); clusterConnection.removeRecord(targetNodeID);
if (scaleDown) { if (scaleDown) {
try { executor.execute(() -> {
queue.deleteQueue(true); logger.debug("Scaling down queue {}", queue);
queue.removeAddress(); try {
} catch (ActiveMQAddressDoesNotExistException e) { queue.deleteQueue(true);
// ignore queue.removeAddress();
} catch (Exception e) { } catch (ActiveMQAddressDoesNotExistException e) {
logger.warn(e.getMessage(), e); logger.debug("ActiveMQAddressDoesNotExistException during scale down for queue {}", queue);
} } catch (Exception e) {
logger.warn(e.getMessage(), e);
}
});
} }
} else { } else {
clusterConnection.disconnectRecord(targetNodeID); clusterConnection.disconnectRecord(targetNodeID);