From: Ivan Hrasko Date: Wed, 29 Mar 2017 13:51:33 +0000 (+0200) Subject: BUG-5280: Close client history after all histories are closed X-Git-Tag: release/carbon~112 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=commitdiff_plain;h=4b9c14ba4a6e81c5bf499714082de77eafc60887 BUG-5280: Close client history after all histories are closed Make sure record history state as closed once we are done with it. Change-Id: Icbdf947ad166b082e06df896741e618e801ecf2e Signed-off-by: Ivan Hrasko --- diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java index a3afa22c26..c15c7c85f2 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/main/java/org/opendaylight/controller/cluster/databroker/actors/dds/AbstractClientHistory.java @@ -88,6 +88,7 @@ public abstract class AbstractClientHistory extends LocalAbortable implements Id if (local != State.CLOSED) { Preconditions.checkState(local == State.IDLE, "Local history %s has an open transaction", this); histories.values().forEach(ProxyHistory::close); + updateState(local, State.CLOSED); } } diff --git a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java index 11379a0bf2..a8fc8eecee 100644 --- a/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java +++ b/opendaylight/md-sal/sal-distributed-datastore/src/test/java/org/opendaylight/controller/cluster/datastore/DistributedDataStoreIntegrationTest.java @@ -1002,9 +1002,6 @@ public class DistributedDataStoreIntegrationTest { @Test public void testCreateChainedTransactionAfterClose() throws Exception { - //TODO remove when test passes also for ClientBackedDataStore - Assume.assumeTrue(testParameter.equals(DistributedDataStore.class)); - new IntegrationTestKit(getSystem(), datastoreContextBuilder) { { try (AbstractDataStore dataStore = setupAbstractDataStore( @@ -1023,9 +1020,6 @@ public class DistributedDataStoreIntegrationTest { @Test public void testChainWithReadOnlyTxAfterPreviousReady() throws Exception { - //TODO remove when test passes also for ClientBackedDataStore - Assume.assumeTrue(testParameter.equals(DistributedDataStore.class)); - new IntegrationTestKit(getSystem(), datastoreContextBuilder) { { try (final AbstractDataStore dataStore = setupAbstractDataStore( @@ -1165,9 +1159,6 @@ public class DistributedDataStoreIntegrationTest { @Test public void testChangeListenerRegistration() throws Exception { - //TODO remove when test passes also for ClientBackedDataStore - Assume.assumeTrue(testParameter.equals(DistributedDataStore.class)); - new IntegrationTestKit(getSystem(), datastoreContextBuilder) { { try (final AbstractDataStore dataStore = setupAbstractDataStore(