Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,6 @@ private void failoverOrReconnect(final Object connectionID,
sessionsToClose = new HashSet<>(sessions);
}
callFailoverListeners(FailoverEventType.FAILOVER_FAILED);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jbertram why this call wasn't moved with the other?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't move this call because it's not directly related to this deadlock. The thread dump on ARTEMIS-6066 shows that there's no problem with this call since it completes before the call to callSessionFailureListeners.

I suppose it's possible that this call should be moved as well, but I was trying to minimize the changes to only what was necessary to resolve this particular deadlock.

callSessionFailureListeners(me, true, false, scaleDownTargetNodeID);
}
} finally {
localFailoverLock.unlock();
Expand All @@ -795,7 +794,10 @@ private void failoverOrReconnect(final Object connectionID,
// 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
Expand Down