Properly synchronize NetconfDeviceTopologyAdapter 96/107696/5
authorRobert Varga <robert.varga@pantheon.tech>
Mon, 4 Sep 2023 20:53:33 +0000 (22:53 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Tue, 5 Sep 2023 13:01:08 +0000 (15:01 +0200)
commit2816f35e72f8e30f5b902b5e21209b7c7d0d235a
tree343f311eb004279db3c77fba635de0d964e25fd5
parent1580cdde112def996e9a0b4afd116b049c5c1feb
Properly synchronize NetconfDeviceTopologyAdapter

The adapter is using TransactionChain, which should always be guarded.
Make sure we guard that even when callers fail to provide their own
guards.

There is a further bug, where a failed last transaction would not
complete the closeFuture(), leaving callers stack.

Finally we disconnect from AutoCloseable and provide a shutdown()
method, which allows users to decide on how to synchronize the datastore
access. This allows us to concurrently shutdown the mount point and
datastore state and wait for the completion of the latter only after
both actions have been initiated.

JIRA: NETCONF-1146
Change-Id: Ieeb6ca485bed3553224f6845d04ae07d4c5d5176
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
apps/netconf-topology-singleton/src/main/java/org/opendaylight/netconf/topology/singleton/impl/MasterSalFacade.java
apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapter.java
apps/netconf-topology/src/main/java/org/opendaylight/netconf/topology/spi/NetconfTopologyDeviceSalFacade.java
apps/netconf-topology/src/test/java/org/opendaylight/netconf/topology/spi/NetconfDeviceTopologyAdapterTest.java