ARTEMIS-4804 & ARTEMIS-4805 mitigate NPEs in ScaleDownHandler

This commit is contained in:
Justin Bertram 2024-08-30 15:40:50 -05:00 committed by clebertsuconic
parent ec8026e4d6
commit 8b265f4625
2 changed files with 4 additions and 1 deletions

View File

@ -240,4 +240,7 @@ public interface ActiveMQClientMessageBundle {
@Message(id = 219068, value = "Connection closed while receiving cluster topology. Group:{}")
ActiveMQObjectClosedException connectionClosedOnReceiveTopology(DiscoveryGroup discoveryGroup);
@Message(id = 219069, value = "Unable to create Session. Either the ClientSessionFactory is closed or the ClientProtocolManager is dead.")
IllegalStateException unableToCreateSession();
}

View File

@ -846,7 +846,7 @@ public class ClientSessionFactoryImpl implements ClientSessionFactoryInternal, C
synchronized (sessions) {
if (closed || !clientProtocolManager.isAlive()) {
session.close();
return null;
throw ActiveMQClientMessageBundle.BUNDLE.unableToCreateSession();
}
sessions.add(session);
}