Prevent deadlock between PCEP session mgmt and stats thread 66/89966/4
authorAjay Lele <ajayslele@gmail.com>
Tue, 26 May 2020 17:59:57 +0000 (10:59 -0700)
committerAjay Lele <ajayslele@gmail.com>
Mon, 10 Aug 2020 04:35:10 +0000 (04:35 +0000)
commitb481a55c539be1987b303cbfab9fb190b56828dc
tree3685233ac7b0773bb2f085fe474490febded7e03
parent00c4039225b87d025709f41c6ef8d7b2610500f8
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>
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java