This is an automated email from the ASF dual-hosted git repository.

tabish121 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/artemis.git


The following commit(s) were added to refs/heads/main by this push:
     new 6794e2cfe4 ARTEMIS-6066 deadlock with Core federation consumer
6794e2cfe4 is described below

commit 6794e2cfe43b345bd58171b02a11d4a832136033
Author: Justin Bertram <[email protected]>
AuthorDate: Thu May 14 16:23:16 2026 -0500

    ARTEMIS-6066 deadlock with Core federation consumer
    
    I was unable to reproduce the deadlock with a test so static analysis
    will have to suffice here. The solution has the benefit of being
    alongside another bit of code that is explicitly identified as necessary
    to prevent deadlocks.
---
 .../activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java   | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
index 421ee4ee4d..267d38f03b 100644
--- 
a/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
+++ 
b/artemis-core-client/src/main/java/org/apache/activemq/artemis/core/client/impl/ClientSessionFactoryImpl.java
@@ -786,7 +786,6 @@ public class ClientSessionFactoryImpl implements 
ClientSessionFactoryInternal, C
                sessionsToClose = new HashSet<>(sessions);
             }
             callFailoverListeners(FailoverEventType.FAILOVER_FAILED);
-            callSessionFailureListeners(me, true, false, 
scaleDownTargetNodeID);
          }
       } finally {
          localFailoverLock.unlock();
@@ -795,7 +794,10 @@ public class ClientSessionFactoryImpl implements 
ClientSessionFactoryInternal, C
       // This needs to be outside the failover lock to prevent deadlock
       if (connection != null) {
          callSessionFailureListeners(me, true, true);
+      } else {
+         callSessionFailureListeners(me, true, false, scaleDownTargetNodeID);
       }
+
       if (sessionsToClose != null) {
          // If connection is null it means we didn't succeed in failing over 
or reconnecting
          // so we close all the sessions, so they will throw exceptions when 
attempted to be used


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to