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 01be464..cfd59a5 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 7b57263..6ecb8c8 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();
             }
         }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.