Acquire read-lock of network topology during path calculation
Change-Id: Ibd98422cd2f078c3c57d2cd379a1b6008fcb092b
diff --git a/src/main/java/net/onrc/onos/intent/runtime/PathCalcRuntime.java b/src/main/java/net/onrc/onos/intent/runtime/PathCalcRuntime.java
index 043a006..64d3def 100644
--- a/src/main/java/net/onrc/onos/intent/runtime/PathCalcRuntime.java
+++ b/src/main/java/net/onrc/onos/intent/runtime/PathCalcRuntime.java
@@ -42,6 +42,9 @@
IntentOperationList pathIntentOpList = new IntentOperationList();
HashMap<Switch, ConstrainedBFSTree> spfTrees = new HashMap<>();
+ // TODO optimize locking of NetworkGraph
+ graph.acquireReadLock();
+
for (IntentOperation intentOp: intentOpList) {
switch (intentOp.operator) {
case ADD:
@@ -119,6 +122,9 @@
break;
}
}
+ // TODO optimize locking of NetworkGraph
+ graph.releaseReadLock();
+
return pathIntentOpList;
}
}
\ No newline at end of file