Fix unsynchronized LSP counting 06/82906/1
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 3 Jul 2019 08:40:26 +0000 (10:40 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 3 Jul 2019 08:49:51 +0000 (10:49 +0200)
commite0ae4f223028652a3c88a0a96e2c371d5d348daf
treef065ac9dc60d765e94e63b61ce2166dba627904f
parent2380fa157df7c4772a1dd33e36cc58d7214e90d5
Fix unsynchronized LSP counting

Trying to copy values out of lspData without holding the lock
can result it ConcurrentModificationException and was broken
by the fix for BGPCEP-845.

Restore the lock for the duration of the copy and count the items
outside of the lock.

JIRA: BGPCEP-875
Change-Id: Ic6e839cac51a73c0812aabb58e96cb2f4959c4d6
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
(cherry picked from commit 5089a36f11b2f9d249aeca53da867037be26fe1b)
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java