Catch all exceptions when submitting in tx handlers 42/59842/2
authorTomas Cere <tcere@cisco.com>
Thu, 8 Jun 2017 09:48:00 +0000 (11:48 +0200)
committerRobert Varga <nite@hq.sk>
Mon, 3 Jul 2017 11:08:16 +0000 (11:08 +0000)
Change-Id: I5b9a2ec26b1b6001423f2cf5cf57285ce6c7e340
Signed-off-by: Tomas Cere <tcere@cisco.com>
(cherry picked from commit 31a52c56cb4e8398403f299d0c3d3830084e260e)

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 278a963ce7a0c76683deca006894763583562736..01be4645bccb62e719b745a80e4d5ef3e41de564 100644 (file)
@@ -139,7 +139,7 @@ public class ProduceTransactionsHandler implements Runnable {
 
         try {
             tx.submit().checkedGet(125, TimeUnit.SECONDS);
-        } catch (final TransactionCommitFailedException | TimeoutException e) {
+        } catch (final Exception e) {
             LOG.warn("Unable to fill the initial item list.", e);
             settableFuture.set(RpcResultBuilder.<ProduceTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
@@ -203,7 +203,7 @@ public class ProduceTransactionsHandler implements Runnable {
                         .withResult(output).build());
 
                 executor.shutdown();
-            } catch (InterruptedException | ExecutionException | TimeoutException exception) {
+            } catch (Exception exception) {
                 LOG.error("Write transactions failed.", exception);
                 completionFuture.set(RpcResultBuilder.<ProduceTransactionsOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", exception).build());
index e9c5ffb6ee9da5024cb54ae2ac227655422b1a35..7b5726315784b674737656687b828a377177fe1e 100644 (file)
@@ -165,7 +165,7 @@ public class WriteTransactionsHandler implements Runnable {
 
         try {
             tx.submit().checkedGet(125, TimeUnit.SECONDS);
-        } catch (final TransactionCommitFailedException | TimeoutException e) {
+        } catch (final Exception e) {
             LOG.warn("Unable to ensure IdInts list for id: {} exists.", id, e);
             settableFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
@@ -186,7 +186,7 @@ public class WriteTransactionsHandler implements Runnable {
 
         try {
             tx.submit().checkedGet(125, TimeUnit.SECONDS);
-        } catch (final TransactionCommitFailedException | TimeoutException e) {
+        } catch (final Exception e) {
             LOG.warn("Unable to fill the initial item list.", e);
             settableFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
@@ -245,7 +245,7 @@ public class WriteTransactionsHandler implements Runnable {
                         .withResult(output).build());
 
                 executor.shutdown();
-            } catch (InterruptedException | ExecutionException | TimeoutException exception) {
+            } catch (Exception exception) {
                 LOG.error("Write transactions failed.", exception);
                 completionFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
                         .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", exception).build());