<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:15:41 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>[NETCONF-705] Netconf lock/unlock issue when multiple request arrives for the same device</title>
                <link>https://jira.opendaylight.org/browse/NETCONF-705</link>
                <project id="10142" key="NETCONF">netconf</project>
                    <description>&lt;p&gt;when multiple requests for the same device arrives:&lt;/p&gt;

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

&lt;p&gt;&lt;b&gt;Scenario 1: (Tested with confd)&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;When device supports both the capability&#160; :candidate&#160; and :writable-running&#160;:&lt;/b&gt;&lt;/p&gt;

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

&lt;p&gt;Even though lock has been denied for the lock transaction , Netconf still continues to execute get-config, edit-config and commit transactions&#160;&lt;/p&gt;

&lt;p&gt;Later it checks results of all above transactions , if any of the transactions fails then &quot;discard-changes&quot; will be executed.&lt;/p&gt;

&lt;p&gt;But commit transaction is already done and therefore all the changes will be updated to&#160;running configuration datastore&lt;/p&gt;

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

&lt;p&gt;&lt;b&gt;Scenario 2 :&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;when device supports only&#160;:writable-running&#160;:&lt;/p&gt;

&lt;p&gt;As per code analysis, It will continue with get-config, edit-config and unlock transactions to running configuration datastore even though lock transaction has been denied.&lt;/p&gt;

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

&lt;p&gt;&lt;b&gt;Response from Restconf :&lt;/b&gt;&lt;/p&gt;

&lt;p&gt;Restconf returns error response but netconf internally executed all the rpc transactions to the device&lt;/p&gt;

&lt;p&gt;&amp;lt;errors xmlns=&quot;urn:ietf:params:xml:ns:yang:ietf-restconf&quot;&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;error&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;error-type&amp;gt;application&amp;lt;/error-type&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;error-tag&amp;gt;operation-failed&amp;lt;/error-tag&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;error-message&amp;gt;Commit of transaction org.opendaylight.netconf.sal.connect.netconf.sal.tx.WriteCandidateRunningTx@3c57aac1 failed&amp;lt;/error-message&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;error-info&amp;gt;RemoteDevice{confd-netconf-device}:RPC during tx failed. the configuration database is locked by session 16 admin ssh (netconf from XXX.XX.XX.XX ) on since 2020-06-26 13:47:19&amp;lt;session-id&amp;gt;16&amp;lt;/session-id&amp;gt;the configuration database is locked by session 16 admin ssh (netconf from XXX.XX.XX.XX ) on since 2020-06-26 13:47:19&amp;lt;session-id&amp;gt;16&amp;lt;/session-id&amp;gt;&amp;lt;/error-info&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/error&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;/errors&amp;gt;&lt;/p&gt;

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

&lt;p&gt;&#160;&lt;/p&gt;</description>
                <environment>&lt;p&gt;Tested scenario 1 with confd device.&lt;/p&gt;

&lt;p&gt;Attached request details and confd logs for reference.&lt;/p&gt;</environment>
        <key id="32808">NETCONF-705</key>
            <summary>Netconf lock/unlock issue when multiple request arrives for the same device</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                            <priority id="2" iconUrl="https://jira.opendaylight.org/images/icons/priorities/critical.svg">High</priority>
                        <status id="5" iconUrl="https://jira.opendaylight.org/images/icons/statuses/resolved.png" description="A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.">Resolved</status>
                    <statusCategory id="3" key="done" colorName="green"/>
                                    <resolution id="10000">Done</resolution>
                                        <assignee username="Sarguna_Dharani">Sarguna Dharani</assignee>
                                    <reporter username="Sarguna">Sarguna Dharani</reporter>
                        <labels>
                            <label>pt</label>
                    </labels>
                <created>Fri, 26 Jun 2020 10:04:02 +0000</created>
                <updated>Fri, 2 Jul 2021 19:46:21 +0000</updated>
                            <resolved>Fri, 2 Jul 2021 19:46:21 +0000</resolved>
                                                    <fixVersion>1.13.1</fixVersion>
                                    <component>netconf</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>9</watches>
                                                                                                                <comments>
                            <comment id="68300" author="jluhrsen" created="Fri, 26 Jun 2020 16:39:23 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna_Dharani&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna_Dharani&quot;&gt;Sarguna_Dharani&lt;/a&gt;, do you have the body you are using to mount this device?&lt;/p&gt;

&lt;p&gt;Also, I saw you assigned this to yourself. Do you have plans to fix?&lt;/p&gt;

&lt;p&gt;Let me know how I can help.&lt;/p&gt;</comment>
                            <comment id="68301" author="JIRAUSER12948" created="Fri, 26 Jun 2020 16:57:01 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=jluhrsen&quot; class=&quot;user-hover&quot; rel=&quot;jluhrsen&quot;&gt;jluhrsen&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;Thanks for the reply. Yes, I have committed the fix for it.&lt;/p&gt;

&lt;p&gt;And I have used below payload for mounting confd device,&lt;/p&gt;

&lt;p&gt;&amp;lt;node xmlns=&quot;urn:TBD:params:xml:ns:yang:network-topology&quot;&amp;gt;&lt;br/&gt;
 &amp;lt;node-id&amp;gt;confd-netconf-device&amp;lt;/node-id&amp;gt;&lt;br/&gt;
 &amp;lt;host xmlns=&quot;urn:opendaylight:netconf-node-topology&quot;&amp;gt;XXX.XX.XX.XX&amp;lt;/host&amp;gt;&lt;br/&gt;
 &amp;lt;port xmlns=&quot;urn:opendaylight:netconf-node-topology&quot;&amp;gt;2022&amp;lt;/port&amp;gt;&lt;br/&gt;
 &amp;lt;username xmlns=&quot;urn:opendaylight:netconf-node-topology&quot;&amp;gt;admin&amp;lt;/username&amp;gt;&lt;br/&gt;
 &amp;lt;password xmlns=&quot;urn:opendaylight:netconf-node-topology&quot;&amp;gt;root&amp;lt;/password&amp;gt;&lt;br/&gt;
 &amp;lt;tcp-only xmlns=&quot;urn:opendaylight:netconf-node-topology&quot;&amp;gt;false&amp;lt;/tcp-only&amp;gt; &lt;br/&gt;
 &amp;lt;/node&amp;gt;&lt;/p&gt;</comment>
                            <comment id="68313" author="jluhrsen" created="Wed, 1 Jul 2020 21:53:06 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna_Dharani&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna_Dharani&quot;&gt;Sarguna_Dharani&lt;/a&gt;, I also commented in the gerrit but wondering if you had the bandwidth to add unit test coverage for these cases?&lt;/p&gt;</comment>
                            <comment id="68400" author="jluhrsen" created="Fri, 3 Jul 2020 05:57:52 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna&quot;&gt;Sarguna&lt;/a&gt;, I pulled your code locally and built it to test. I have a Junos device that is only :candidate and I still see the&lt;br/&gt;
problem I think is reported here.&lt;/p&gt;

&lt;p&gt;two curl commands back to back to delete an existing interface (small 3s sleep between to make reading the logs easier).&lt;br/&gt;
I see the first request grab the lock, get-config, edit-config, commit, unlock... Somewhere before the unlock the 2nd&lt;br/&gt;
request tries to get the lock and it fails, but things just continue the same with that request... get-config, edit-config,&lt;br/&gt;
commit, unlock.&lt;/p&gt;

&lt;p&gt;Am I following this correctly? Should the 2nd request get the lock denied and just quit at that point responding to the&lt;br/&gt;
calling client about the error? Is that what you see with your confd environment?&lt;/p&gt;</comment>
                            <comment id="68401" author="JIRAUSER12948" created="Fri, 3 Jul 2020 06:48:44 +0000"  >&lt;p&gt;Hi Jamo,&lt;/p&gt;

&lt;p&gt;Can you please check whether you get lock-denied for the 2nd request&#160;from the device&lt;/p&gt;

&lt;p&gt;When I tested this case, testtool doesn&apos;t give rpc-reply as lock-denied for the 2nd request&lt;/p&gt;

&lt;p&gt;You can check this by executing 2 lock request simultaneously&lt;/p&gt;

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

&lt;p&gt;&lt;a href=&quot;http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/confd-netconf-device/yang-ext:mount/ietf-netconf:lock&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://localhost:8181/restconf/operations/network-topology:network-topology/topology/topology-netconf/node/&amp;lt;device-name&amp;gt;/yang-ext:mount/ietf-netconf:lock&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If device accepts the second lock , then definitely it will continues with other transaction.&lt;/p&gt;

&lt;p&gt;If device denies the second lock , it should immediately stop and respond error to calling client.&lt;/p&gt;

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

&lt;p&gt;If lock has been denied in your testing for second request , can you please include netconf and device logs here&#160;&#160;&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="68404" author="JIRAUSER12948" created="Fri, 3 Jul 2020 15:20:18 +0000"  >&lt;p&gt;Hi Jamo,&lt;/p&gt;

&lt;p&gt;I found the issue. The thing is DELETE works in different way , it uses &quot;exists&quot; functionality of MDSAL to trigger get-config transactions.&lt;/p&gt;

&lt;p&gt;But PUT calls uses &quot;read&quot; functionality of MDSAL&#160;to trigger get-config transactions.&lt;/p&gt;

&lt;p&gt;Only in read calls , there is check for lock transactions&lt;/p&gt;

&lt;p&gt;I am adding the fix for it.&lt;/p&gt;

&lt;p&gt;&#160;&lt;/p&gt;</comment>
                            <comment id="68406" author="jluhrsen" created="Mon, 6 Jul 2020 18:12:33 +0000"  >&lt;p&gt;great! thanks &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna&quot;&gt;Sarguna&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I&apos;ll work to get these scenarios covered in CSIT as well. Not sure how easy&lt;br/&gt;
the UT would be, but maybe CSIT will be enough to help catch regressions.&lt;/p&gt;</comment>
                            <comment id="68408" author="jluhrsen" created="Tue, 7 Jul 2020 16:16:02 +0000"  >&lt;p&gt;&lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=cmanoj&quot; class=&quot;user-hover&quot; rel=&quot;cmanoj&quot;&gt;cmanoj&lt;/a&gt;will take a look at doing this CSIT&lt;/p&gt;</comment>
                            <comment id="68489" author="jluhrsen" created="Thu, 23 Jul 2020 23:12:35 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna&quot;&gt;Sarguna&lt;/a&gt;, wondering if you have any update on this?&lt;/p&gt;</comment>
                            <comment id="68509" author="JIRAUSER12948" created="Mon, 3 Aug 2020 11:31:44 +0000"  >&lt;p&gt;Hi Jamo,&#160;&lt;/p&gt;

&lt;p&gt;Included changes for both Delete calls and Unit Testing.&#160;&lt;/p&gt;</comment>
                            <comment id="68513" author="jluhrsen" created="Mon, 3 Aug 2020 22:05:24 +0000"  >&lt;p&gt;Thank you &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna_Dharani&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna_Dharani&quot;&gt;Sarguna_Dharani&lt;/a&gt; I&apos;ve tested locally with the distribution built from your patch and&lt;br/&gt;
things seem to work as expected.&lt;/p&gt;</comment>
                            <comment id="68732" author="rovarga" created="Wed, 28 Oct 2020 11:56:14 +0000"  >&lt;p&gt;So reading through this a bit more, the RESTCONF seems to be okay&#160;&#8211; we can improve it by adding a dedicated case. The problem is what sal-netconf-connector does, which is that it plows on even in case of rejection. I think the patch is going to be more involved.&lt;/p&gt;</comment>
                            <comment id="68797" author="JIRAUSER12903" created="Wed, 9 Dec 2020 10:49:37 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=jluhrsen&quot; class=&quot;user-hover&quot; rel=&quot;jluhrsen&quot;&gt;jluhrsen&lt;/a&gt;&lt;br/&gt;
Is there any CSIT already covers these scenarios?&lt;br/&gt;
Have prepared changes for it. And I am wondering how I can properly test it&lt;/p&gt;</comment>
                            <comment id="68799" author="jluhrsen" created="Wed, 9 Dec 2020 21:08:10 +0000"  >&lt;p&gt;no, I don&apos;t think any CSIT was written for this yet unfortunately. I had intended to come up with something eventually but&lt;br/&gt;
I no longer have the cycles for it. &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/sad.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                            <comment id="69019" author="JIRAUSER12941" created="Tue, 9 Mar 2021 11:37:38 +0000"  >&lt;p&gt;Hi &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=Sarguna&quot; class=&quot;user-hover&quot; rel=&quot;Sarguna&quot;&gt;Sarguna&lt;/a&gt;&#160;and &lt;a href=&quot;https://jira.opendaylight.org/secure/ViewProfile.jspa?name=jluhrsen&quot; class=&quot;user-hover&quot; rel=&quot;jluhrsen&quot;&gt;jluhrsen&lt;/a&gt;,&lt;/p&gt;

&lt;p&gt;I&apos;ve changed the design slightly; it should only execute operations from the transaction if the lock operation is completed successfully. I noticed a couple of other issues during testing, like an unexpected lock/unlock state that happened because of parallel transactions, so I had to fix that as well.&lt;/p&gt;

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

&lt;p&gt;The patch is available here - &lt;a href=&quot;https://git.opendaylight.org/gerrit/c/netconf/+/95359&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/c/netconf/+/95359&lt;/a&gt;; for some reason, JIRA associates my patch with a different&#160;issue &lt;img class=&quot;emoticon&quot; src=&quot;https://jira.opendaylight.org/images/icons/emoticons/smile.png&quot; height=&quot;16&quot; width=&quot;16&quot; align=&quot;absmiddle&quot; alt=&quot;&quot; border=&quot;0&quot;/&gt;&lt;/p&gt;</comment>
                    </comments>
                <issuelinks>
                            <issuelinktype id="10000">
                    <name>Blocks</name>
                                            <outwardlinks description="blocks">
                                        <issuelink>
            <issuekey id="33613">NETCONF-746</issuekey>
        </issuelink>
                            </outwardlinks>
                                                        </issuelinktype>
                    </issuelinks>
                <attachments>
                            <attachment id="15664" name="Lock_Unlock_issue_Simultaneous_call.docx" size="121326" author="Sarguna" created="Fri, 26 Jun 2020 10:00:33 +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|i03tc7:</customfieldvalue>

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