BUG 8422: Change tx handlers hard timeout
[controller.git] / opendaylight / md-sal / samples / clustering-test-app / provider / src / main / java / org / opendaylight / controller / clustering / it / provider / impl / ProduceTransactionsHandler.java
index 0d49a697d6d5b1227ee704bbb5099233b07cf05c..7ce2b8ded6562b6df6df571ca4c87dd2f14b7348 100644 (file)
@@ -143,8 +143,8 @@ public class ProduceTransactionsHandler implements Runnable {
         cursor.close();
 
         try {
         cursor.close();
 
         try {
-            tx.submit().checkedGet();
-        } catch (final TransactionCommitFailedException e) {
+            tx.submit().checkedGet(125, TimeUnit.SECONDS);
+        } catch (final TransactionCommitFailedException | TimeoutException e) {
             LOG.warn("Unable to fill the initial item list.", e);
             settableFuture.set(RpcResultBuilder.<ProduceTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
             LOG.warn("Unable to fill the initial item list.", e);
             settableFuture.set(RpcResultBuilder.<ProduceTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
@@ -192,7 +192,8 @@ public class ProduceTransactionsHandler implements Runnable {
             final ListenableFuture<List<Void>> allFutures = Futures.allAsList(futures);
 
             try {
             final ListenableFuture<List<Void>> allFutures = Futures.allAsList(futures);
 
             try {
-                allFutures.get(30, TimeUnit.SECONDS);
+                // Timeout from cds should be 2 minutes so leave some leeway.
+                allFutures.get(125, TimeUnit.SECONDS);
 
                 LOG.debug("All futures completed successfully.");
 
 
                 LOG.debug("All futures completed successfully.");