Bug 5913: Fix ISE in DefaultShardDataChangeListenerPublisher 24/40324/2
authorTom Pantelis <tpanteli@brocade.com>
Tue, 14 Jun 2016 14:18:30 +0000 (10:18 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Wed, 15 Jun 2016 03:45:24 +0000 (03:45 +0000)
commit2277d060b3322def1d3de5d39a2934f418a4850d
tree6ce552c274dceea2f0a047ac388936f62a03c6bb
parent7165284351a98e19016d08c1d62af30d880ed315
Bug 5913: Fix ISE in DefaultShardDataChangeListenerPublisher

The publishChanges method is only called from the
ShardDataTreeNotificationPublisherActor which is single-threaded so
publishChanges can't be called concurrently. However the
DefaultShardDataChangeListenerPublisher instance is passed via
the PublishNotifications message so the Stopwatch isn't thread safe
wrt thread visibility of its internal state. Therefore it's possible
the change in state done on thread 1 isn't immediately visible to
a subsequent thread. To alleviate this, I moved the Stopwatch and the
elapsed time check to the ShardDataTreeNotificationPublisherActor.

Change-Id: I046e7e92aa96eec01d5a355c8431ef797c534ead
Signed-off-by: Tom Pantelis <tpanteli@brocade.com>
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/AbstractShardDataTreeNotificationPublisherActorProxy.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataChangeListenerPublisher.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/DefaultShardDataTreeChangeListenerPublisher.java
opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/datastore/ShardDataTreeNotificationPublisherActor.java