Committed by
Gerrit Code Review
Handle duplicate listen requests submitted to the state machine
Change-Id: I9f17be5a751f7f2b17f8e89232dc0403ca260137
Showing
1 changed file
with
4 additions
and
1 deletions
... | @@ -318,7 +318,10 @@ public class AtomixConsistentMapState extends ResourceStateMachine implements Se | ... | @@ -318,7 +318,10 @@ public class AtomixConsistentMapState extends ResourceStateMachine implements Se |
318 | */ | 318 | */ |
319 | protected void listen(Commit<? extends Listen> commit) { | 319 | protected void listen(Commit<? extends Listen> commit) { |
320 | Long sessionId = commit.session().id(); | 320 | Long sessionId = commit.session().id(); |
321 | - listeners.put(sessionId, commit); | 321 | + if (listeners.putIfAbsent(sessionId, commit) != null) { |
322 | + commit.close(); | ||
323 | + return; | ||
324 | + } | ||
322 | commit.session() | 325 | commit.session() |
323 | .onStateChange( | 326 | .onStateChange( |
324 | state -> { | 327 | state -> { | ... | ... |
-
Please register or login to post a comment