Fix BGPPeer internal locking 20/78820/1
authorRobert Varga <robert.varga@pantheon.tech>
Sat, 15 Dec 2018 17:10:56 +0000 (18:10 +0100)
committerRobert Varga <robert.varga@pantheon.tech>
Sat, 15 Dec 2018 17:15:40 +0000 (18:15 +0100)
commitad61c39ee2503d1506d125bb80e35d351710bc76
tree7126525c8e7c5831db373f2c0fbe496ebc2a8b33
parent2d5f12e857c10f59b12f2efe8bac7761e0b25ca1
Fix BGPPeer internal locking

onRouteRefreshMessage() is not synchronized and manipulates
adjRibOutListenerSet, which is a thread-safety hazard.

Fix by holding a lock for the duration needed, as well as
use a single remove() operation instead of get/remove combo.

Finally lower private method synchronization and replace it
with @GuardedBy annotations, so that it is understood those
methods are only ever called with the lock already held.

Change-Id: Idd509a345dfc3afa800e7456fb6d3bdbd1f367e7
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
bgp/rib-impl/src/main/java/org/opendaylight/protocol/bgp/rib/impl/BGPPeer.java