BUG-509: make sure datastore commits are visible 13/5913/2
authorRobert Varga <rovarga@cisco.com>
Fri, 4 Apr 2014 17:50:57 +0000 (19:50 +0200)
committerRobert Varga <rovarga@cisco.com>
Sun, 6 Apr 2014 16:24:21 +0000 (18:24 +0200)
commit641b91bad029954a55c4373f9f9001ef109c04ae
tree8f5f0e1af3bccaa851c53c4c5589f8200af84f1c
parent7e7bdaec36dd670a10939b57d96d44432291b77d
BUG-509: make sure datastore commits are visible

This wraps the datastore root in an AtomicReference, which makes sure
started transactions see the latest published commit. This will make
the datastore handling more robust under tight conditions.

Also uncovers the fact that we are invoking user code under lock, which
we fix by reusing the executor used by the commit machinery.

Finally it uncovers thread-unsafe listener list manipuation. This will
need to be addressed in a follow-up patch.

Change-Id: Ic7efd266ef680701c1f0944ee675122d8527568b
Signed-off-by: Robert Varga <rovarga@cisco.com>
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/ChangeListenerNotifyTask.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/InMemoryDOMDataStore.java
opendaylight/md-sal/sal-dom-broker/src/main/java/org/opendaylight/controller/md/sal/dom/store/impl/tree/ListenerRegistrationNode.java