PCEP Thread deadlock 67/77667/3
authorClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sat, 10 Nov 2018 17:53:15 +0000 (18:53 +0100)
committerClaudio D. Gasparini <claudio.gasparini@pantheon.tech>
Sat, 10 Nov 2018 22:15:21 +0000 (23:15 +0100)
Change-Id: I7b1f6fcf8c678c76750c501ce979813a20fa8313
JIRA: BGPCEP-845
Signed-off-by: Claudio D. Gasparini <claudio.gasparini@pantheon.tech>
pcep/topology/topology-provider/src/main/java/org/opendaylight/bgpcep/pcep/topology/provider/AbstractTopologySessionListener.java

index c812a970e1249276196bf0b48659d345d2ade263..b2e04957d02eaf577c5da807527f4aa0813dcc99 100755 (executable)
@@ -10,6 +10,7 @@ package org.opendaylight.bgpcep.pcep.topology.provider;
 import static java.util.Objects.requireNonNull;
 
 import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableList;
 import com.google.common.util.concurrent.FluentFuture;
 import com.google.common.util.concurrent.FutureCallback;
 import com.google.common.util.concurrent.Futures;
@@ -592,8 +593,8 @@ public abstract class AbstractTopologySessionListener<S, L> implements TopologyS
     }
 
     @Override
-    public synchronized int getDelegatedLspsCount() {
-        return Math.toIntExact(this.lspData.values().stream()
+    public int getDelegatedLspsCount() {
+        return Math.toIntExact(ImmutableList.copyOf(this.lspData.values()).stream()
                 .map(ReportedLsp::getPath).filter(Objects::nonNull).filter(pathList -> !pathList.isEmpty())
                 // pick the first path, as delegate status should be same in each path
                 .map(pathList -> pathList.get(0))