[MDSAL-838] AbstractPingPongTransactionChain is not idempotent Created: 03/Sep/23  Updated: 04/Sep/23  Resolved: 04/Sep/23

Status: Resolved
Project: mdsal
Component/s: DOM API
Affects Version/s: 3.0.16, 4.0.17, 5.0.17, 6.0.12, 7.0.14, 8.0.16, 9.0.8, 10.0.8, 11.0.12, 12.0.1
Fix Version/s: 10.0.9, 11.0.13, 12.0.2

Type: Bug Priority: Medium
Reporter: Robert Varga Assignee: Robert Varga
Resolution: Done Votes: 0
Labels: pt
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Relates
relates to NETCONF-1146 Operational data of netconf-topology ... Resolved

 Description   

The following is reported during NetconfDeviceTopologyAdapter shutdown:

2023-08-31T22:31:51,461 | ERROR | CommitFutures-2  | AbstractFuture                   | 46 - com.google.guava - 32.1.2.jre | RuntimeException while executing runnable CallbackListener{org.opendaylight.mdsal.binding.dom.adapter.BindingDOMTransactionChainAdapter$3@3e776ba1} with executor MoreExecutors.directExecutor()
java.lang.IllegalStateException: Attempted to close an already-closed chain
        at com.google.common.base.Preconditions.checkState(Preconditions.java:512) ~[bundleFile:?]
        at org.opendaylight.mdsal.dom.spi.AbstractPingPongTransactionChain.close(AbstractPingPongTransactionChain.java:389) ~[bundleFile:?]
        at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMTransactionChainAdapter.close(BindingDOMTransactionChainAdapter.java:116) ~[bundleFile:?]
        at org.opendaylight.netconf.topology.spi.NetconfDeviceTopologyAdapter.onTransactionChainFailed(NetconfDeviceTopologyAdapter.java:127) ~[bundleFile:?]
        at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMTransactionChainAdapter.failTransactionChain(BindingDOMTransactionChainAdapter.java:111) ~[bundleFile:?]
        at org.opendaylight.mdsal.binding.dom.adapter.BindingDOMTransactionChainAdapter$3.onFailure(BindingDOMTransactionChainAdapter.java:92) ~[bundleFile:?]
        at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1119) ~[bundleFile:?]
        at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:807) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:105) ~[bundleFile:?]
        at com.google.common.util.concurrent.DirectExecutor.execute(DirectExecutor.java:31) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1286) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:1055) ~[bundleFile:?]
        at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:807) ~[bundleFile:?]
        at com.google.common.util.concurrent.SettableFuture.setException(SettableFuture.java:55) ~[bundleFile:?]
        at org.opendaylight.mdsal.dom.spi.PingPongTransaction.onFailure(PingPongTransaction.java:56) ~[bundleFile:?]
        at org.opendaylight.mdsal.dom.spi.AbstractPingPongTransactionChain.transactionFailed(AbstractPingPongTransactionChain.java:295) ~[bundleFile:?]
        at org.opendaylight.mdsal.dom.spi.AbstractPingPongTransactionChain$2.onFailure(AbstractPingPongTransactionChain.java:242) ~[bundleFile:?]
        at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1127) ~[bundleFile:?]
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) ~[?:?]
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) ~[?:?]
        at java.lang.Thread.run(Thread.java:833) ~[?:?]

This is part of NETCONF-1146, i.e. we have shut down the chain, but the last transaction failed to commit, hence the callback, where we do follow the API spec and issue another close().

Now DOMTransactionChain.close() is supposed to be idempotent to the best of its abilities, as implied by AutoCloseable.close() and the spirit of Registration.close(). Audit AbstractPingPongTransactionChain.close() and make sure it is idempotent.


Generated at Wed Feb 07 20:11:06 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.