Fix a race PingPongTransactionChain 06/14106/2
authorRobert Varga <rovarga@cisco.com>
Mon, 12 Jan 2015 15:52:00 +0000 (16:52 +0100)
committerRobert Varga <rovarga@cisco.com>
Mon, 12 Jan 2015 16:12:45 +0000 (17:12 +0100)
As it turns out, we have made an illegal shortcut while readying a transaction. This results in the following exception,
which occurs if we happen to want to allocate a transaction while it is being submitted to backed.

Exception in thread "Thread-18" java.lang.IllegalStateException: Previous transaction DOM-OPER-9 is not ready yet
        at com.google.common.base.Preconditions.checkState(Preconditions.java:176)
        at org.opendaylight.controller.md.sal.dom.store.impl.DOMStoreTransactionChainImpl$Allocated.getSnapshot(DOMStoreTransactionChainImpl.java:68)
        at org.opendaylight.controller.md.sal.dom.store.impl.DOMStoreTransactionChainImpl.getSnapshot(DOMStoreTransactionChainImpl.java:111)
        at org.opendaylight.controller.md.sal.dom.store.impl.DOMStoreTransactionChainImpl.newReadWriteTransaction(DOMStoreTransactionChainImpl.java:131)
        at org.opendaylight.controller.md.sal.dom.broker.impl.AbstractDOMForwardedTransactionFactory.newReadWriteTransaction(AbstractDOMForwardedTransactionFactory.java:206)
        at org.opendaylight.controller.md.sal.dom.broker.impl.PingPongTransactionChain.slowAllocateTransaction(PingPongTransactionChain.java:128)
        at org.opendaylight.controller.md.sal.dom.broker.impl.PingPongTransactionChain.allocateTransaction(PingPongTransactionChain.java:145)
        at org.opendaylight.controller.md.sal.dom.broker.impl.PingPongTransactionChain.newReadWriteTransaction(PingPongTransactionChain.java:279)
        at org.opendaylight.controller.md.sal.dom.broker.impl.PingPongTransactionChain.newWriteOnlyTransaction(PingPongTransactionChain.java:310)
        at org.opendaylight.controller.md.sal.binding.impl.BindingTranslatedTransactionChain.newWriteOnlyTransaction(BindingTranslatedTransactionChain.java:77)
        at org.opendaylight.protocol.bgp.rib.impl.RIBImpl$1.run(RIBImpl.java:125)
        at java.lang.Thread.run(Thread.java:745)

Change-Id: Ie21cf5f0ebba79fa25358da2ee1e6b22cfb0f906
Signed-off-by: Robert Varga <rovarga@cisco.com>

No differences found