Bug 2187: Don't close over internal state in ShardManager 18/29718/4
authorTom Pantelis <tpanteli@brocade.com>
Sat, 14 Nov 2015 12:41:00 +0000 (07:41 -0500)
committerTom Pantelis <tpanteli@brocade.com>
Mon, 16 Nov 2015 19:01:38 +0000 (14:01 -0500)
commit62bc70796cebbf866ee41e0b9e98006461f19153
tree275cccfc7ed4f3a80270f2758b55d7ba37f29fb4
parentfbc126f0ee9f2a50cd6450378976d4ed32c2dce8
Bug 2187: Don't close over internal state in ShardManager

For AddShardReplica, we use the ask pattern for the FindPrimary and
AddServer messages. However in the OnComplete callbacks we're closing
over internal state which isn't safe since the callback will be notified
outside of the actor's execution context which may result in concurrent
mutation of internal state. Therefore I added internal messages that are
sent to self in the callbacks.

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