commit | e60388716f0c2353f5b43bfcee53b8d8af6c47e9 | [log] [tgz] |
---|---|---|
author | Madan Jampani <madan.jampani@gmail.com> | Thu Mar 03 12:14:37 2016 -0800 |
committer | Gerrit Code Review <gerrit@onlab.us> | Thu Mar 03 20:28:54 2016 +0000 |
tree | 70b27a1dd75dfeca747036fcaa5a482babd1319c | |
parent | 434e68dd8ff2acf8c5b108889fba58e21bc2bab5 [diff] |
Handle duplicate listen requests submitted to the state machine Change-Id: I9f17be5a751f7f2b17f8e89232dc0403ca260137
diff --git a/core/store/primitives/src/main/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapState.java b/core/store/primitives/src/main/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapState.java index 6395f69..31b6d76 100644 --- a/core/store/primitives/src/main/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapState.java +++ b/core/store/primitives/src/main/java/org/onosproject/store/primitives/resources/impl/AtomixConsistentMapState.java
@@ -318,7 +318,10 @@ */ 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 -> {