[CONTROLLER-1812] DOMForwardedWriteTransaction infinite loop on cancel after exception Created: 01/Feb/18  Updated: 23/Feb/18  Resolved: 23/Feb/18

Status: Resolved
Project: controller
Component/s: mdsal
Affects Version/s: Oxygen
Fix Version/s: Oxygen

Type: Bug Priority: Medium
Reporter: Jaime Caamaño Ruiz Assignee: Jaime Caamaño Ruiz
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by MDSAL-79 Controller stop fails Resolved

 Description   

If you cancel DOMForwardedWriteTransaction after an exception thrown by the backed transaction ready or submit methods, you run into an infinite loop.

This was encountered on an instance where the backed transaction threw an IllegalArgumentException on ready due to mandatory data missing:

java.lang.IllegalArgumentException: Node (urn:cisco:params:xml:ns:yang:sfc-rsp?revision=2014-07-01)rendered-service-path[{(urn:cisco:params:xml:ns:yang:sfc-rsp?revision=2014-07-01)name=RSP1}] is missing mandatory descendant /(urn:cisco:params:xml:ns:yang:sfc-rsp?revision=2014-07-01)reverse-path
 at com.google.common.base.Preconditions.checkArgument(Preconditions.java:434)
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.MandatoryLeafEnforcer$Strict.enforceOnData(MandatoryLeafEnforcer.java:44)
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.ListEntryModificationStrategy.verifyStructure(ListEntryModificationStrategy.java:34)
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.ModifiedNode.seal(ModifiedNode.java:283)
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.AbstractReadyIterator.process(AbstractReadyIterator.java:47)
 at org.opendaylight.yangtools.yang.data.impl.schema.tree.InMemoryDataTreeModification.ready(InMemoryDataTreeModification.java:285)
 at org.opendaylight.controller.sal.core.spi.data.SnapshotBackedWriteTransaction.ready(SnapshotBackedWriteTransaction.java:141)
 at org.opendaylight.controller.md.sal.dom.broker.impl.DOMForwardedWriteTransaction.submit(DOMForwardedWriteTransaction.java:148)
 at org.opendaylight.controller.md.sal.binding.impl.AbstractWriteTransaction.doSubmit(AbstractWriteTransaction.java:134)
 at org.opendaylight.controller.md.sal.binding.impl.BindingDOMWriteTransactionAdapter.submit(BindingDOMWriteTransactionAdapter.java:81)
 at org.opendaylight.genius.infra.ManagedNewTransactionRunnerImpl.callWithNewWriteOnlyTransactionAndSubmit(ManagedNewTransactionRunnerImpl.java:46)
 at org.opendaylight.genius.infra.RetryingManagedNewTransactionRunnerImpl.callWithNewWriteOnlyTransactionAndSubmit(RetryingManagedNewTransactionRunnerImpl.java:64)
 at org.opendaylight.genius.infra.RetryingManagedNewTransactionRunnerImpl.callWithNewWriteOnlyTransactionAndSubmit(RetryingManagedNewTransactionRunnerImpl.java:57)
 at org.opendaylight.genius.infra.RetryingManagedNewTransactionRunner.callWithNewWriteOnlyTransactionAndSubmit(RetryingManagedNewTransactionRunner.java:41)
 at org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker.syncWrite(SingleTransactionDataBroker.java:194)
 at org.opendaylight.genius.datastoreutils.SingleTransactionDataBroker.syncWrite(SingleTransactionDataBroker.java:186)
 at org.opendaylight.genius.mdsalutil.MDSALUtil.syncWrite(MDSALUtil.java:581)
 at org.opendaylight.netvirt.sfc.classifier.providers.SfcProviderTest.storeRsp(SfcProviderTest.java:172)
 at org.opendaylight.netvirt.sfc.classifier.providers.SfcProviderTest.getRenderedServicePath(SfcProviderTest.java:64)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
 at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
 at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
 at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
 at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
 at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
 at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
 at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
 at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
 at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
 at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
 at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
 at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
 at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
 at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
 at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
 at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
 at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)


 Comments   
Comment by Robert Varga [ 01/Feb/18 ]

Can you update the description with the exception thrown, please?

Comment by Robert Varga [ 01/Feb/18 ]

Thanks. So it would seem we need a companion patch to go with this, fixing SnapshotBackedWriteTransaction.ready() to catch the failure and propagate it to TransactionReadyPrototype, which should then report the failure through DOMStoreThreePhaseCommitCohort.

Comment by Robert Varga [ 01/Feb/18 ]

Both the patches need to also be ported to mdsal's equivalent classes.

Comment by Jaime Caamaño Ruiz [ 07/Feb/18 ]

So progress is ongoing for the two patches on controller [1] and [2]. Once those are set, I will port to mdsal, if that's ok.

[1] https://git.opendaylight.org/gerrit/#/c/67804/

[2] https://git.opendaylight.org/gerrit/#/c/67914/

Comment by Jaime Caamaño Ruiz [ 08/Feb/18 ]

Should we have a separate bug report for MDSAL?

Comment by Robert Varga [ 08/Feb/18 ]

I don't think we need one – just reference this issue in those patches.

Generated at Wed Feb 07 19:56:31 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.