BUG-7768 Synchronize ServerSessionManager for PCEP 67/51767/2
authorKevin Wang <kevixw@gmail.com>
Thu, 9 Feb 2017 22:40:23 +0000 (14:40 -0800)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Tue, 14 Feb 2017 09:55:06 +0000 (09:55 +0000)
commit696e6bc88e23223c7609631408264d3c6cc3717e
tree705dda674ab211ea8b23b8f259cff21d45665af1
parentd0ffe8fcc17da43117b3de9c6b6c3c00a178adc6
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>
(cherry picked from commit 7a866eee4dec5dc368ef11c90473b3c2a256f281)
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