BUG 8494 log possibly hanged futures in tx handlers 39/58739/2
authorTomas Cere <tcere@cisco.com>
Mon, 12 Jun 2017 13:29:46 +0000 (15:29 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 12 Jun 2017 20:18:17 +0000 (20:18 +0000)
Change-Id: Iccc90e575033c6770a3a499853f31e0684a712e4
Signed-off-by: Tomas Cere <tcere@cisco.com>
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/ProduceTransactionsHandler.java
opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/WriteTransactionsHandler.java

index 81d783712489388fe7b8f76b6c2a263169efb7ba..54ac682a3c73c63559415ef0ba93097a74d48820 100644 (file)
@@ -214,6 +214,13 @@ public class ProduceTransactionsHandler implements Runnable {
                 completionFuture.set(RpcResultBuilder.<ProduceTransactionsOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", exception).build());
 
+                for (int i = 0; i < futures.size(); i++) {
+                    final CheckedFuture<Void, TransactionCommitFailedException> future = futures.get(i);
+                    if (!future.isDone()) {
+                        LOG.warn("Future #{}/{} possibly hanged.", future, futures.size());
+                    }
+                }
+
                 executor.shutdown();
             } finally {
                 try {
index 7b5726315784b674737656687b828a377177fe1e..6ecb8c8381391ada67198d1db587a427bdbe6496 100644 (file)
@@ -250,6 +250,13 @@ public class WriteTransactionsHandler implements Runnable {
                 completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", exception).build());
 
+                for (int i = 0; i < futures.size(); i++) {
+                    final CheckedFuture<Void, TransactionCommitFailedException> future = futures.get(i);
+                    if (!future.isDone()) {
+                        LOG.warn("Future #{}/{} possibly hanged.", future, futures.size());
+                    }
+                }
+
                 executor.shutdown();
             }
         }