BUG-7768 Synchronize ServerSessionManager for PCEP 05/51705/1
authorKevin Wang <kevixw@gmail.com>
Thu, 9 Feb 2017 22:40:23 +0000 (14:40 -0800)
committerKevin Wang <kevixw@gmail.com>
Sat, 11 Feb 2017 00:23:22 +0000 (16:23 -0800)
commit7a866eee4dec5dc368ef11c90473b3c2a256f281
tree027a3adeb0f79ba75d37e33b9a03483d5ec6f597
parentec57bcaaaee06edc2288029df2a7a78442375b56
BUG-7768 Synchronize ServerSessionManager for PCEP

Add the check so that session manager can only be closed once
and becomes unusable after closing.

A java.util.ConcurrentModificationException is possible to happen
due to the close() method of ServerSessionManager is not synchronized.
The situation mostly likely will happen during a controller reboot.
It may also happen when a PCEP config is updated. The ServerSessionManager
is being restarted while all the PCEP negotiation is still happening.

Change-Id: I0e0d387add046a4fe9ec5ac74a85f8350e238d60
Signed-off-by: Kevin Wang <kevixw@gmail.com>
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/PCEPTopologyProvider.java
pcep/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/ServerSessionManager.java