Bug 5913: Fix ISE in DefaultShardDataChangeListenerPublisher 06/40306/2
authorTom Pantelis <tpanteli@brocade.com>
Tue, 14 Jun 2016 14:18:30 +0000 (10:18 -0400)
committerTom Pantelis <tpanteli@brocade.com>
Tue, 14 Jun 2016 20:54:51 +0000 (20:54 +0000)
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>

No differences found