This makes write-transactions/produce-transactions return an
RpcError upon reaching 2 minutes of waiting after the last
transaction is submitted in case the transactions arent timed out
from the frontend.
Change-Id: I20abbd02ed14e16d9e9a49f935113c0044e7c6d8
Signed-off-by: Tomas Cere <tcere@cisco.com>
- 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());
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.");
tx.put(LogicalDatastoreType.CONFIGURATION, itemListId, mapBuilder.build());
try {
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());
LOG.warn("Unable to fill the initial item list.", e);
settableFuture.set(RpcResultBuilder.<WriteTransactionsOutput>failed()
.withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build());
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.");