BUG 8494 log possibly hanged futures in tx handlers 43/59843/2
authorTomas Cere <tcere@cisco.com>
Mon, 12 Jun 2017 13:29:46 +0000 (15:29 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 3 Jul 2017 11:08:16 +0000 (11:08 +0000)
Change-Id: Iccc90e575033c6770a3a499853f31e0684a712e4
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 0723037074588cb901212e9b3ad9bf437e754f89)

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 01be4645bccb62e719b745a80e4d5ef3e41de564..cfd59a52511264cf8d22a37c36abf1599abb0951 100644 (file)
@@ -208,6 +208,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();
             }
         }