Manage race condition when deleting interface 09/96909/6
authorGilles Thouenon <gilles.thouenon@orange.com>
Tue, 29 Jun 2021 07:18:15 +0000 (09:18 +0200)
committerGilles Thouenon <gilles.thouenon@orange.com>
Fri, 30 Jul 2021 15:11:29 +0000 (17:11 +0200)
Since rendering tasks are parallelized, an exception may occur if the
interface to delete has just been deleted by another task. Delete action
on the device datastore needs to be in a monolithic block.

JIRA: TRNSPRTPCE-487
Signed-off-by: Gilles Thouenon <gilles.thouenon@orange.com>
Change-Id: I20a25fa43f510e26f886287535ec5e1341345824

common/src/main/java/org/opendaylight/transportpce/common/openroadminterfaces/OpenRoadmInterfacesImpl221.java

index 3bee34472e76af41ad64b5a14b91dedf6fc4a171..6db81a9c1c97a3b2c306ee5bc6ec0eade44bf147 100755 (executable)
@@ -91,7 +91,7 @@ public class OpenRoadmInterfacesImpl221 {
     }
 
 
-    public void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
+    public synchronized void deleteInterface(String nodeId, String interfaceName) throws OpenRoadmInterfaceException {
         LOG.info("deleting interface {} on device221 {}", interfaceName, nodeId);
         Optional<Interface> intf2DeleteOpt;
         try {