X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsamples%2Fclustering-test-app%2Fprovider%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fclustering%2Fit%2Fprovider%2Fimpl%2FProduceTransactionsHandler.java;h=54ac682a3c73c63559415ef0ba93097a74d48820;hb=0723037074588cb901212e9b3ad9bf437e754f89;hp=6af5beb0647cd267f3be70468d6e79b936091bef;hpb=5daa19c25730a83fa5d0eb510b47ff159fe734fb;p=controller.git diff --git a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/ProduceTransactionsHandler.java b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/ProduceTransactionsHandler.java index 6af5beb064..54ac682a3c 100644 --- a/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/ProduceTransactionsHandler.java +++ b/opendaylight/md-sal/samples/clustering-test-app/provider/src/main/java/org/opendaylight/controller/clustering/it/provider/impl/ProduceTransactionsHandler.java @@ -124,11 +124,6 @@ public class ProduceTransactionsHandler implements Runnable { LOG.debug("Filling the item list with initial values."); final CollectionNodeBuilder mapBuilder = ImmutableNodes.mapNodeBuilder(ITEM); - for (int i = 0; i < MAX_ITEM / 2; i++) { - usedValues.add(i); - mapBuilder.withChild(ImmutableNodes.mapEntry(ITEM, NUMBER, i)); - } - idListWithKey = ID_INT_YID.node(new NodeIdentifierWithPredicates(ID_INT, ID, id)); itemProducer = domDataTreeService.createProducer( @@ -144,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.failed() .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build()); @@ -214,11 +209,18 @@ 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.failed() .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", exception).build()); + for (int i = 0; i < futures.size(); i++) { + final CheckedFuture future = futures.get(i); + if (!future.isDone()) { + LOG.warn("Future #{}/{} possibly hanged.", future, futures.size()); + } + } + executor.shutdown(); } finally { try {