-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Labels
Milestone
Description
I'm pretty sure that there is potential race condition in the following code:
Set<Topic> set = listenerTopics.get(listener);
if (set == null) {
set = new CopyOnWriteArraySet<>();
listenerTopics.put(listener, set);
}The solution could be to replace it with something like this:
Set<Topic> set = listenerTopics.computeIfAbsent(listener, $ -> new CopyOnWriteArraySet<>());Line 649 in fc9f9d8
| Set<Topic> set = listenerTopics.get(listener); |