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=6af5beb0647cd267f3be70468d6e79b936091bef;hb=188b3e7bb59bd60f9806ffe7afff564d064cb986;hp=0d49a697d6d5b1227ee704bbb5099233b07cf05c;hpb=32deb316c47ad4ad60bcd7ee3a398fa778c8f397;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 0d49a697d6..6af5beb064 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 @@ -57,7 +57,7 @@ public class ProduceTransactionsHandler implements Runnable { static final QName ID_INTS = QName.create("tag:opendaylight.org,2017:controller:yang:lowlevel:target", "2017-02-15", "id-ints"); - static final QName ID_INT = + public static final QName ID_INT = QName.create("tag:opendaylight.org,2017:controller:yang:lowlevel:target", "2017-02-15", "id-int"); static final QName ID = QName.create("tag:opendaylight.org,2017:controller:yang:lowlevel:target", "2017-02-15", "id"); @@ -143,11 +143,17 @@ public class ProduceTransactionsHandler implements Runnable { 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.failed() .withError(RpcError.ErrorType.APPLICATION, "Unexpected-exception", e).build()); + + try { + itemProducer.close(); + } catch (final DOMDataTreeProducerException exception) { + LOG.warn("Failure while closing producer.", exception); + } return false; } @@ -192,7 +198,8 @@ public class ProduceTransactionsHandler implements Runnable { final ListenableFuture> 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.");