FUTURE_REAPER_SERVICE.schedule(new Runnable() {
@Override
public void run() {
- if (sf.isDone() || sf.isCancelled()) {
- return;
+ CallContext cc = methodContext.remove(request.getId());
+ if ( cc != null) {
+ if ( cc.getFuture().isDone() || cc.getFuture().isCancelled()) {
+ return;
+ }
+ cc.getFuture().cancel(false);
}
- methodContext.remove(request.getId()).getFuture().cancel(false);
}
},REAPER_INTERVAL, TimeUnit.MILLISECONDS);
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);
}
}
-
}