<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:33:12 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>[OPNFLWPLUG-717] He plugin: Race condition in statistics manager.</title>
                <link>https://jira.opendaylight.org/browse/OPNFLWPLUG-717</link>
                <project id="10155" key="OPNFLWPLUG">OpenFlowPlugin</project>
                    <description>&lt;p&gt;I observed that statistics information for some flow entries were missing from operational DS occasionally when I installed so many flow entries (more than 1000 flows per OF switch).&lt;/p&gt;

&lt;p&gt;I looked into statistics manager sources, then I found 2 bugs that might drop statistics information.&lt;/p&gt;

&lt;p&gt;1. Stats RPC manager (StatRpcMsgManagerImpl) associates transaction container&lt;br/&gt;
   with the XID returned by stats RPC in txCache. When statistics information&lt;br/&gt;
   is notified, stats notification listener searches for the container associated&lt;br/&gt;
   with the XID, and stores received notification into that container.&lt;br/&gt;
   But statistics information may be notified before the transaction container&lt;br/&gt;
   is put into txCache because the stats RPC manager does not wait for the&lt;br/&gt;
   completion of stats RPC on the stats RPC manager thread.&lt;/p&gt;

&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Although StatRpcMsgManagerImpl.registrationRpcFutureCallBack() is always&lt;br/&gt;
       called on the stats RPC manager thread, it uses FutureCallback to detect&lt;br/&gt;
       completion of stats RPC. So registrationRpcFutureCallBack() may return&lt;br/&gt;
       before stats RPC completes. The XID returned by stats RPC will be put&lt;br/&gt;
       into txCache on a future polling thread&lt;br/&gt;
       (JdkFutureAdapters.listenInPoolThread()).&lt;/li&gt;
&lt;/ul&gt;


&lt;ul class=&quot;alternate&quot; type=&quot;square&quot;&gt;
	&lt;li&gt;Stats notification listener calls isExpectedStatistics() to check the&lt;br/&gt;
       XID, and that check will be done on the stats RPC manager thread&lt;br/&gt;
       (statRpcMsgManagerExecutor).&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;   For example, once get-all-flows-statistics-from-all-flow-tables RPC is&lt;br/&gt;
   invoked, StatListenCommitFlow.onFlowsStatisticsUpdate() may be called&lt;br/&gt;
   irrespective of whether StatRpcMsgManagerImpl.registrationRpcFutureCallBack()&lt;br/&gt;
   puts the XID into txCache. onFlowsStatisticsUpdate() will drop flow&lt;br/&gt;
   statistics in flows-statistics-update notification if the XID is not present&lt;br/&gt;
   in txCache.&lt;/p&gt;

&lt;p&gt;   All stats notification listener methods need to wait for stats RPC manager&lt;br/&gt;
   to put the XID and transaction container into txCache.&lt;/p&gt;

&lt;p&gt;2. Stats RPC notification listener method appends the received notification&lt;br/&gt;
   into the transaction container associated with the XID using&lt;br/&gt;
   StatRpcMsgManagerImpl.addNotification(). addNotification() creates a task&lt;br/&gt;
   that appends the received notification into the container, and enqueue it&lt;br/&gt;
   into the RPC job queue. That task will be executed on the stats RPC manager&lt;br/&gt;
   thread.&lt;/p&gt;

&lt;p&gt;   If listener methods receives the last notification (moreReplies flag is not&lt;br/&gt;
   set), it enqueues a DS operation that stores received statistics information&lt;br/&gt;
   into operational DS. That operation will be executed on the DS operation&lt;br/&gt;
   thread (statDataStoreOperationServ).&lt;/p&gt;

&lt;p&gt;   Therefore, above 2 operations will be executed on different threads in&lt;br/&gt;
   parallel. But DS operation does not wait for the completion of the task&lt;br/&gt;
   created by addNotification(). So DS operation may store statistics information&lt;br/&gt;
   to operational DS before the last notification is added to the transaction&lt;br/&gt;
   container.&lt;/p&gt;

&lt;p&gt;   For example, onFlowStatisticsUpdate() enqueues a DS operation that stores&lt;br/&gt;
   flow statistics into operational DS when moreReplies flag is not set in&lt;br/&gt;
   the received notification. If that DS operation is scheduled on the DS&lt;br/&gt;
   operation thread before the task created by addNotification() is scheduled&lt;br/&gt;
   on the stats RPC manager thread, flow statistics in the last notification&lt;br/&gt;
   will be dropped.&lt;/p&gt;

&lt;p&gt;   I believe that the simplest solution is not to use the stats RPC manager&lt;br/&gt;
   thread. If addNotification() appends the received notification to the&lt;br/&gt;
   container on the calling thread, DS operation will be enqueud after all&lt;br/&gt;
   notifications are added to the transaction container. So DS operation does&lt;br/&gt;
   not need to wait for completion of addNotification() tasks.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="27985">OPNFLWPLUG-717</key>
            <summary>He plugin: Race condition in statistics manager.</summary>
                <type id="10104" iconUrl="https://jira.opendaylight.org/secure/viewavatar?size=xsmall&amp;avatarId=10303&amp;avatarType=issuetype">Bug</type>
                                                <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="shuva.jyoti.kar.87@gmail.com">Shuva Jyoti Kar</assignee>
                                    <reporter username="yasuda">Shigeru Yasuda</reporter>
                        <labels>
                    </labels>
                <created>Fri, 24 Jun 2016 13:43:56 +0000</created>
                <updated>Mon, 27 Sep 2021 09:01:50 +0000</updated>
                            <resolved>Thu, 22 Jun 2017 08:45:53 +0000</resolved>
                                                                    <component>General</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="57974" author="yasuda" created="Fri, 24 Jun 2016 13:47:13 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/40817&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/40817&lt;/a&gt;  (master)&lt;/p&gt;</comment>
                            <comment id="57975" author="miroslav.macko" created="Mon, 3 Oct 2016 11:53:02 +0000"  >&lt;p&gt;Hello Shuva,&lt;/p&gt;

&lt;p&gt;What is status with this please? &lt;/p&gt;

&lt;p&gt;Thanks.&lt;br/&gt;
Miro&lt;/p&gt;</comment>
                            <comment id="57976" author="yasuda" created="Thu, 16 Mar 2017 07:53:09 +0000"  >&lt;p&gt;&lt;a href=&quot;https://git.opendaylight.org/gerrit/44117&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/44117&lt;/a&gt;  (stable/boron)&lt;br/&gt;
&lt;a href=&quot;https://git.opendaylight.org/gerrit/44118&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;https://git.opendaylight.org/gerrit/44118&lt;/a&gt;  (stable/beryllium)&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                    </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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>6110</customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                <customfield id="customfield_10201" key="com.atlassian.jira.plugin.system.customfieldtypes:url">
                        <customfieldname>External issue URL</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue><![CDATA[https://bugs.opendaylight.org/show_bug.cgi?id=6110]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                <customfield id="customfield_10000" key="com.pyxis.greenhopper.jira:gh-lexo-rank">
                        <customfieldname>Rank</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>0|i032vj:</customfieldvalue>

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