Update shutdownTx before acting on it 32/114032/2
authorRobert Varga <robert.varga@pantheon.tech>
Wed, 16 Oct 2024 15:34:49 +0000 (17:34 +0200)
committerRobert Varga <robert.varga@pantheon.tech>
Wed, 16 Oct 2024 15:45:39 +0000 (17:45 +0200)
As evidenced in the logs, we can end up looping on shutdownTx
multiple times -- if it is completed by the time we pick it up
processNextTransaction().

Since it is already completed, our callback executes immediately through
processTransaction() and loops back to processNextTransaction() -- and
we pick it up again and try to commit() it again.

Fix this thinko by clearing shutdownTx before we pass the transaction
to processTransaction() -- hence if we re-enter, we will just observe
shutdownTx as null and do nothing.

JIRA: MDSAL-872
Change-Id: I2d92000fc76d374aeaf354734d80b128d2709cfb
Signed-off-by: Robert Varga <robert.varga@pantheon.tech>
dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/AbstractPingPongTransactionChain.java

index 044ff913bd8cd20406dcdfbc0aa1d980edd76188..1c4b5ec1af2b6dde527e18961eee96fcc115cda3 100644 (file)
@@ -283,9 +283,9 @@ abstract class AbstractPingPongTransactionChain implements DOMTransactionChain {
         if (nextTx == null) {
             final PingPongTransaction local = shutdownTx;
             if (local != null) {
+                shutdownTx = null;
                 processTransaction(local);
                 delegate.close();
-                shutdownTx = null;
             }
         } else {
             processTransaction(nextTx);