Madan Jampani
Committed by Gerrit Code Review

Handle duplicate listen requests submitted to the state machine

Change-Id: I9f17be5a751f7f2b17f8e89232dc0403ca260137
......@@ -318,7 +318,10 @@ public class AtomixConsistentMapState extends ResourceStateMachine implements Se
*/
protected void listen(Commit<? extends Listen> commit) {
Long sessionId = commit.session().id();
listeners.put(sessionId, commit);
if (listeners.putIfAbsent(sessionId, commit) != null) {
commit.close();
return;
}
commit.session()
.onStateChange(
state -> {
......