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 / WriteTransactionsHandler.java
index e4236abc7b38adf6c55034d696ff2ad2e6e5ac32..c4abb391e64b94e59a5058d018d887af3e55d680 100644 (file)
@@ -189,8 +189,8 @@ public class WriteTransactionsHandler implements Runnable {
         tx.put(LogicalDatastoreType.CONFIGURATION, itemListId, mapBuilder.build());
 
         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.<WriteTransactionsOutput>failed()
                     .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
@@ -234,7 +234,8 @@ public class WriteTransactionsHandler implements Runnable {
             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.");