Skip to content

Commit 8b265f4

Browse files
jbertramclebertsuconic
authored andcommittedSep 5, 2024·
ARTEMIS-4804 & ARTEMIS-4805 mitigate NPEs in ScaleDownHandler
1 parent ec8026e commit 8b265f4

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed
 

‎artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/ActiveMQClientMessageBundle.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,7 @@ public interface ActiveMQClientMessageBundle {
240240

241241
@Message(id = 219068, value = "Connection closed while receiving cluster topology. Group:{}")
242242
ActiveMQObjectClosedException connectionClosedOnReceiveTopology(DiscoveryGroup discoveryGroup);
243+
244+
@Message(id = 219069, value = "Unable to create Session. Either the ClientSessionFactory is closed or the ClientProtocolManager is dead.")
245+
IllegalStateException unableToCreateSession();
243246
}

‎artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -846,7 +846,7 @@ private ClientSession createSessionInternal(final String rawUsername,
846846
synchronized (sessions) {
847847
if (closed || !clientProtocolManager.isAlive()) {
848848
session.close();
849-
return null;
849+
throw ActiveMQClientMessageBundle.BUNDLE.unableToCreateSession();
850850
}
851851
sessions.add(session);
852852
}

0 commit comments

Comments
 (0)
Please sign in to comment.