Skip to content

Commit

Permalink
acquire lock before checking message listeners in MessagesCache
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi-signal authored and jon-signal committed Jul 26, 2023
1 parent 901c950 commit baf98ac
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,10 @@ public void addMessageAvailabilityListener(final UUID destinationUuid, final lon
}

public void removeMessageAvailabilityListener(final MessageAvailabilityListener listener) {
@Nullable final String queueName = queueNamesByMessageListener.get(listener);
@Nullable final String queueName;
synchronized (messageListenersByQueueName) {
queueName = queueNamesByMessageListener.get(listener);
}

if (queueName != null) {
unsubscribeFromKeyspaceNotifications(queueName);
Expand Down

0 comments on commit baf98ac

Please sign in to comment.