From: Robert Varga Date: Wed, 16 Oct 2024 15:34:49 +0000 (+0200) Subject: Update shutdownTx before acting on it X-Git-Tag: v14.0.4~6 X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=commitdiff_plain;h=ac6c4d0598b6a0469f09a121f6e60c2ebb59041c;p=mdsal.git Update shutdownTx before acting on it 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 --- diff --git a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/AbstractPingPongTransactionChain.java b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/AbstractPingPongTransactionChain.java index 044ff913bd..1c4b5ec1af 100644 --- a/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/AbstractPingPongTransactionChain.java +++ b/dom/mdsal-dom-spi/src/main/java/org/opendaylight/mdsal/dom/spi/AbstractPingPongTransactionChain.java @@ -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);