Prevent deadlock between PCEP session mgmt and stats thread 85/92085/2
authorAjay Lele <ajayslele@gmail.com>
Tue, 26 May 2020 17:59:57 +0000 (10:59 -0700)
committerRobert Varga <nite@hq.sk>
Thu, 5 Nov 2020 16:58:58 +0000 (16:58 +0000)
commitf71d18eb38778240f901ee469d6b8fe37f020268
treefebadbc7820768b899214fbcf7fc6c93c7ca1f2f
parentafb46454d1f57e81785324ffd1f92c935d9d8da7
Prevent deadlock between PCEP session mgmt and stats thread

Deadlock happens between 2 threads trying to acquire lock on
Stateful07TopologySessionListener and TopologyStatsProviderImpl
instance in reverse order. In AbstractTopologySessionListener#getDelegatedLspsCount(),
locking was added to avoid ConcurrentModificationException for
lspData map. Patch achieves same result without having to acquire
the lock by using thread-safe ConcurrentHashMap for lspData.

JIRA: BGPCEP-901
Change-Id: I74b5070c2e1c8075f5df9504d6eef4de541597fd
Signed-off-by: Ajay Lele <ajayslele@gmail.com>
Signed-off-by: Deepthi V V <dvv@luminanetworks.com>
(cherry picked from commit b481a55c539be1987b303cbfab9fb190b56828dc)
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java