<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:14:07 UTC 2024

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary append 'field=key&field=summary' to the URL of your request.
-->
<rss version="0.92" >
<channel>
    <title>OpenDaylight JIRA</title>
    <link>https://jira.opendaylight.org</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>8.20.10</version>
        <build-number>820010</build-number>
        <build-date>22-06-2022</build-date>
    </build-info>


<item>
            <title>[BGPCEP-785] OptimisticLockFailedException when closing multiple sessions</title>
                <link>https://jira.opendaylight.org/browse/BGPCEP-785</link>
                <project id="10108" key="BGPCEP">bgpcep</project>
                    <description>&lt;p&gt;org.opendaylight.mdsal.common.api.OptimisticLockFailedException: Optimistic lock failed for path /(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)bgp-rib/rib/rib[&lt;/p&gt;

{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)id=example-bgp-rib}

&lt;p&gt;]/peer/peer[&lt;/p&gt;

{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)peer-id=bgp://127.0.0.11}

&lt;p&gt;]/adj-rib-in/tables&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Seems to be an internal race condition between DS&#160; modification submision.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Steps for replicate the bug&#160;&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;cherry-pick &lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/72568/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/72568/&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;cherry-pick&#160;&lt;a href=&quot;https://git.opendaylight.org/gerrit/#/c/72566/&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/#/c/72566/&lt;/a&gt;&#160;(BGP with some changes adding logs and removing changes for&#160;an easy&#160;of&#160;log investigation)&lt;/li&gt;
	&lt;li&gt;run ODL&lt;/li&gt;
	&lt;li&gt;feature:install odl-restconf odl-bgpcep-bgp odl-bgpcep-bgp-config-example&lt;/li&gt;
	&lt;li&gt;./configureall.py&lt;/li&gt;
	&lt;li&gt;./manypeersibgp.sh ( run for a few seconds, when seeing&#160;INFO BGP-Dummy-4: Iteration: 2000 - total remaining prefixes: 98000, should be enough for kill it Ctrl+c)&lt;/li&gt;
	&lt;li&gt;check error on logs&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Observation resume&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;Peers write route via Dom chain&lt;/li&gt;
	&lt;li&gt;&#160;Routes session is closed,&#160;&lt;/li&gt;
	&lt;li&gt;&#160;dom chain is closed&lt;/li&gt;
	&lt;li&gt;&#160;Peer&#160;removes table from DS via binding chain&lt;/li&gt;
	&lt;li&gt;binding chain is closed&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;Changes coming from 1 &lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&#160;clashes with changes coming from 4.&lt;/p&gt;

&lt;p&gt;The interesting part is that even 1 is done and submitted before 4 ( the main reason to arrive to this conclusion is because 4 doesn&apos;t fail to close)&lt;/p&gt;

&lt;p&gt;seems that 4 is somehow executed before full 1 has been executed.&lt;/p&gt;

&lt;p&gt;&#160;Logs attached.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&lt;span class=&quot;error&quot;&gt;&amp;#91;0&amp;#93;&lt;/span&gt;&#160;AdjRibInWriter&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160;| 224 - org.opendaylight.bgpcep.bgp-rib-impl - 0.10.0.SNAPSHOT | Write routes failed&lt;/p&gt;

&lt;p&gt;2018-06-01T15:28:26,038 | ERROR | CommitFutures-4 | AdjRibInWriter | 224 - org.opendaylight.bgpcep.bgp-rib-impl - 0.10.0.SNAPSHOT | Write routes failed&lt;br/&gt;
 org.opendaylight.controller.md.sal.common.api.data.OptimisticLockFailedException: Optimistic lock failed for path /(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)bgp-rib/rib/rib[&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)id=example-bgp-rib}
&lt;p&gt;]/peer/peer[&lt;br class=&quot;atl-forced-newline&quot; /&gt;&lt;/p&gt;
{(urn:opendaylight:params:xml:ns:yang:bgp-rib?revision=2018-03-29)peer-id=bgp://127.0.0.11}
&lt;p&gt;]/adj-rib-in/tables&lt;br/&gt;
 at org.opendaylight.controller.cluster.databroker.compat.LegacyDOMDataBrokerAdapter$1.newWithCause(LegacyDOMDataBrokerAdapter.java:66) &lt;span class=&quot;error&quot;&gt;&amp;#91;270:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at org.opendaylight.controller.cluster.databroker.compat.LegacyDOMDataBrokerAdapter$1.newWithCause(LegacyDOMDataBrokerAdapter.java:62) &lt;span class=&quot;error&quot;&gt;&amp;#91;270:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at org.opendaylight.yangtools.util.concurrent.ExceptionMapper.apply(ExceptionMapper.java:106) &lt;span class=&quot;error&quot;&gt;&amp;#91;343:org.opendaylight.yangtools.util:2.0.3&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at org.opendaylight.controller.cluster.databroker.compat.LegacyDOMDataBrokerAdapter$DOMDataTransactionAdapter$1.onFailure(LegacyDOMDataBrokerAdapter.java:301) &lt;span class=&quot;error&quot;&gt;&amp;#91;270:org.opendaylight.controller.sal-distributed-datastore:1.8.0.SNAPSHOT&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.Futures$CallbackListener.run(Futures.java:1387) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.MoreExecutors$DirectExecutor.execute(MoreExecutors.java:398) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.AbstractFuture.executeListener(AbstractFuture.java:1015) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.AbstractFuture.complete(AbstractFuture.java:868) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.AbstractFuture.setException(AbstractFuture.java:713) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at com.google.common.util.concurrent.AbstractTransformFuture.run(AbstractTransformFuture.java:94) &lt;span class=&quot;error&quot;&gt;&amp;#91;75:com.google.guava:23.6.0.jre&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) &lt;span class=&quot;error&quot;&gt;&amp;#91;?:?&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) &lt;span class=&quot;error&quot;&gt;&amp;#91;?:?&amp;#93;&lt;/span&gt;&lt;br/&gt;
 at java.lang.Thread.run(Thread.java:748) &lt;span class=&quot;error&quot;&gt;&amp;#91;?:?&amp;#93;&lt;/span&gt;&lt;br/&gt;
 Caused by: org.opendaylight.yangtools.yang.data.api.schema.tree.ConflictingModificationAppliedException: Node was deleted by other transaction.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment></environment>
        <key id="29624">BGPCEP-785</key>
            <summary>OptimisticLockFailedException when closing multiple sessions</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="3" iconUrl="https://jira.opendaylight.org/images/icons/priorities/major.svg">Medium</priority>
                        <status id="10004" iconUrl="https://jira.opendaylight.org/images/icons/status_generic.gif" description="">Verified</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="cdgasparini">Claudio David Gasparini</assignee>
                                    <reporter username="tomas.markovic">Tomas Markovic</reporter>
                        <labels>
                    </labels>
                <created>Fri, 6 Apr 2018 06:47:44 +0000</created>
                <updated>Thu, 14 Jun 2018 08:17:19 +0000</updated>
                            <resolved>Thu, 14 Jun 2018 08:11:48 +0000</resolved>
                                    <version>Fluorine</version>
                                    <fixVersion>Fluorine</fixVersion>
                                    <component>BGP</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>2</watches>
                                                                                                                <comments>
                            <comment id="63265" author="cdgasparini" created="Mon, 4 Jun 2018 10:24:57 +0000"  >&lt;p&gt;Replicated using mdsal trace tool. We can define that there is no change coming from other different places than the identified ones (1,4).&lt;/p&gt;

&lt;p&gt;Conclusion seems to point that there is a race condition between chain1(update Peer/Adj-rib-in) and chain2 (delete of peer).&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;

&lt;p&gt;Logs added&lt;/p&gt;</comment>
                            <comment id="63419" author="cdgasparini" created="Wed, 13 Jun 2018 08:28:55 +0000"  >&lt;p&gt;Multiple chain can be submitted at different times, but does not imply that&#160; which is submitted first, will finish first. Therefore what is happening here,&lt;/p&gt;

&lt;p&gt;is just that, sometimes ribout removal done by locRibWriter is&#160; been apply after peer close and removal from Data Store, ending on&#160;OptimisticLockFailedException.&lt;/p&gt;

&lt;p&gt;For solve this, we need to make Peer to be the only one on charge of handle and submit changes under Peer ribs,&lt;/p&gt;

&lt;p&gt;and vice versa,&#160; Rib apply through his chains only changes related to Rib ribs( loc-rib-in,..)&lt;/p&gt;

&lt;p&gt;In this way, when a Peer session is closed and clean up done, it wont conflict with changes done by other Rib thread handling changes from different peers.&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="14549" name="10_conf.py" size="1716" author="tomas.markovic" created="Fri, 6 Apr 2018 06:45:46 +0000"/>
                            <attachment id="14669" name="karaf-mdsal-trace.log" size="4489491" author="cdgasparini" created="Mon, 4 Jun 2018 10:19:21 +0000"/>
                            <attachment id="14668" name="karaf.log" size="5191054" author="cdgasparini" created="Fri, 1 Jun 2018 13:51:55 +0000"/>
                            <attachment id="14548" name="manypeers_10.sh" size="173" author="tomas.markovic" created="Fri, 6 Apr 2018 06:45:47 +0000"/>
                            <attachment id="14551" name="odl1_karaf.log.gz" size="263133" author="tomas.markovic" created="Fri, 6 Apr 2018 06:40:42 +0000"/>
                            <attachment id="14550" name="play.py" size="87609" author="tomas.markovic" created="Fri, 6 Apr 2018 06:41:04 +0000"/>
                    </attachments>
                <subtasks>
                    </subtasks>
                <customfields>
                                                                            <customfield id="customfield_11400" key="com.atlassian.jira.plugins.jira-development-integration-plugin:devsummary">
                        <customfieldname>Development</customfieldname>
                        <customfieldvalues>
                            
                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i03cw7:</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                </customfields>
    </item>
</channel>
</rss>