Bug 6284 - Cancellation exceptions during operation execution
[ovsdb.git] / southbound / southbound-impl / src / main / java / org / opendaylight / ovsdb / southbound / ovsdb / transact / TransactInvokerImpl.java
index 80462a686d9768553070c91c6ec7eccd2a704bb1..92ba86b2aff44d71cacdb2e30a74a512ca0bb34d 100644 (file)
@@ -37,7 +37,7 @@ public class TransactInvokerImpl implements TransactInvoker {
     @Override
     public void invoke(TransactCommand command, BridgeOperationalState state,
                        AsyncDataChangeEvent<InstanceIdentifier<?>, DataObject> events) {
-        TransactionBuilder tb = new TransactionBuilder(connectionInstance, dbSchema);
+        TransactionBuilder tb = new TransactionBuilder(connectionInstance.getOvsdbClient(), dbSchema);
         command.execute(tb, state, events);
         invoke(command, tb);
     }
@@ -45,7 +45,7 @@ public class TransactInvokerImpl implements TransactInvoker {
     @Override
     public void invoke(TransactCommand command, BridgeOperationalState state,
                        Collection<DataTreeModification<Node>> modifications) {
-        TransactionBuilder tb = new TransactionBuilder(connectionInstance, dbSchema);
+        TransactionBuilder tb = new TransactionBuilder(connectionInstance.getOvsdbClient(), dbSchema);
         command.execute(tb, state, modifications);
         invoke(command, tb);
     }
@@ -55,13 +55,16 @@ public class TransactInvokerImpl implements TransactInvoker {
         LOG.debug("invoke: command: {}, tb: {}", command, tb);
         if (tb.getOperations().size() > 0) {
             try {
-                List<OperationResult> got = result.get();
-                LOG.debug("OVSDB transaction result: {}", got);
+                if (!result.isCancelled()) {
+                    List<OperationResult> got = result.get();
+                    LOG.debug("OVSDB transaction result: {}", got);
+                } else {
+                    LOG.debug("Operation task cancelled for transaction : {}", tb);
+                }
             } catch (InterruptedException | ExecutionException e) {
                 LOG.warn("Transact execution exception: ", e);
             }
             LOG.trace("invoke exit command: {}, tb: {}", command, tb);
         }
     }
-
 }