Bug 9048: Vpp node reconnect bug in oxygen 19/63619/2
authorMichal Cmarada <mcmarada@cisco.com>
Wed, 27 Sep 2017 13:23:53 +0000 (15:23 +0200)
committerMichal Cmarada <mcmarada@cisco.com>
Wed, 27 Sep 2017 14:09:41 +0000 (14:09 +0000)
due to cache mechanism which was only adding Databroker to
cache and not removing it on delete, we hit issues when reconnecting
the same node, because of wrong Databroker.

Change-Id: I5792256ff6d8e5d419360c7498551dc5e6e473a6
Signed-off-by: Michal Cmarada <mcmarada@cisco.com>
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/manager/VppNodeManager.java
renderers/vpp/src/main/java/org/opendaylight/groupbasedpolicy/renderer/vpp/util/MountedDataBrokerProvider.java

index 3d183b0c5e5c427c14fa1b90d0b045d3ef97bc25..f486a9ea5dcb8e5ebf70e6f5cc32a4e763c13e44 100644 (file)
@@ -260,6 +260,7 @@ public class VppNodeManager {
         final CheckedFuture<Void, TransactionCommitFailedException> checkedFuture = wTx.submit();
         try {
             checkedFuture.checkedGet();
+            mountProvider.deleteDataBrokerForMountPoint(mountPointIid);
             return Futures.immediateFuture(cause);
         } catch (TransactionCommitFailedException e) {
             final String message = String.format("Failed to resolve disconnected node %s", node.getNodeId().getValue());
index ffc2fa653cb78e51ad3c9f3dea136db76d740cec..96c3cb169eefe7097c9c6c8091727059f639c5ff 100644 (file)
@@ -9,6 +9,7 @@
 package org.opendaylight.groupbasedpolicy.renderer.vpp.util;
 
 import java.util.AbstractMap;
+import java.util.Map;
 import java.util.concurrent.Callable;
 import java.util.concurrent.ExecutionException;
 import java.util.concurrent.ExecutorService;
@@ -109,4 +110,8 @@ public class MountedDataBrokerProvider {
         };
         return executorService.submit(task);
     }
+
+    public void deleteDataBrokerForMountPoint(InstanceIdentifier<Node> mountPointIid) {
+        VbdNetconfTransaction.NODE_DATA_BROKER_MAP.remove(mountPointIid);
+    }
 }