You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2025/11/13 20:20:34 UTC
(activemq-artemis) branch pr/6063 created (now 320f6cd64c)
This is an automated email from the ASF dual-hosted git repository.
jbertram pushed a change to branch pr/6063
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
at 320f6cd64c ARTEMIS-5735 avoid race b/w session creation & connection failure
This branch includes the following new commits:
new 320f6cd64c ARTEMIS-5735 avoid race b/w session creation & connection failure
The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@activemq.apache.org
For additional commands, e-mail: commits-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact
(activemq-artemis) 01/01: ARTEMIS-5735 avoid race b/w session creation & connection failure
Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
jbertram pushed a commit to branch pr/6063
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
commit 320f6cd64c0a4c3f8e84a8a4839591cd8745adf7
Author: michaelshemesh <mi...@driivz.com>
AuthorDate: Thu Nov 13 17:13:50 2025 +0200
ARTEMIS-5735 avoid race b/w session creation & connection failure
- add the session to connection failure listener only after it was registered
- close the session if the connection was destroyed in the meantime
---
.../apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java | 4 ++++
.../apache/activemq/artemis/core/server/impl/ServerSessionImpl.java | 1 -
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 8597936a57..47d2c9a34a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -1928,6 +1928,10 @@ public class ActiveMQServerImpl implements ActiveMQServer {
sessions.put(name, session);
totalSessionCount.incrementAndGet();
+ connection.addFailureListener(session);
+ if (connection.isDestroyed()) {
+ session.close(true);
+ }
if (hasBrokerSessionPlugins()) {
callBrokerSessionPlugins(plugin -> plugin.afterCreateSession(session));
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
index b6ffaea8b3..04b3c49620 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ServerSessionImpl.java
@@ -286,7 +286,6 @@ public class ServerSessionImpl extends CriticalComponentImpl implements ServerSe
this.defaultAddress = defaultAddress;
- remotingConnection.addFailureListener(this);
this.context = context;
this.sessionExecutor = server.getExecutorFactory().getExecutor();
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@activemq.apache.org
For additional commands, e-mail: commits-help@activemq.apache.org
For further information, visit: https://activemq.apache.org/contact