<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 20:39:10 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>[SNMP-2] ConcurrentModificationException warnings during walk, incomplete data retrieved</title>
                <link>https://jira.opendaylight.org/browse/SNMP-2</link>
                <project id="10169" key="SNMP">snmp</project>
                    <description>&lt;p&gt;Calls to snmpGet with input type GETWALK return partial results when the result set is large enough.  The problem is only seen in queries that require a number of seconds to execute.&lt;/p&gt;

&lt;p&gt;No error is returned, but results are incomplete.  Caller has no way to know they are incomplete.  Logs contain many stack traces logged as WARN, below.&lt;/p&gt;

&lt;p&gt;Attached test case reproduces the problem consistently.  It connects to a real server.  Any server/oid combination returning a sizable result set should suffice to reproduce this issue.&lt;/p&gt;


&lt;p&gt;               &lt;span class=&quot;error&quot;&gt;&amp;#91;Timer-0&amp;#93;&lt;/span&gt; WARN org.opendaylight.snmp.plugin.internal.AsyncGetHandler - Error parsing response&lt;br/&gt;
               java.util.ConcurrentModificationException&lt;br/&gt;
                   at java.util.ArrayList$Itr.checkForComodification(ArrayList.java:859)&lt;br/&gt;
                   at java.util.ArrayList$Itr.next(ArrayList.java:831)&lt;br/&gt;
                   at org.opendaylight.snmp.plugin.internal.AsyncGetHandler.setResult(AsyncGetHandler.java:125)&lt;br/&gt;
                   at org.opendaylight.snmp.plugin.internal.AsyncGetHandler.onResponse(AsyncGetHandler.java:113)&lt;br/&gt;
                   at org.snmp4j.Snmp$PendingRequest.run(Snmp.java:1721)&lt;br/&gt;
                   at java.util.TimerThread.mainLoop(Timer.java:555)&lt;br/&gt;
                   at java.util.TimerThread.run(Timer.java:505)&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: All&lt;br/&gt;
Platform: All&lt;/p&gt;</environment>
        <key id="26799">SNMP-2</key>
            <summary>ConcurrentModificationException warnings during walk, incomplete data retrieved</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="-1">Unassigned</assignee>
                                    <reporter username="jon@ivydesign.com">Jon Rosenberger</reporter>
                        <labels>
                    </labels>
                <created>Wed, 1 Jul 2015 17:31:21 +0000</created>
                <updated>Thu, 19 Oct 2017 21:25:21 +0000</updated>
                            <resolved>Sun, 12 Jul 2015 05:31:43 +0000</resolved>
                                    <version>unspecified</version>
                                                    <component>General</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>1</watches>
                                                                                                                <comments>
                            <comment id="53843" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:31:21 +0000"  >&lt;p&gt;Attachment testWalkRemote.rtf has been added with description: test case to reproduce issue&lt;/p&gt;</comment>
                            <comment id="53841" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:37:50 +0000"  >&lt;p&gt;The problem: Everything works for several seconds, but then snmp4j begins sending response events to AsyncGetHandler.onResponse() containing null responses, immediately after requests are made.  These are not timeouts; the correct data does arrive after several ms in a separate event as expected.&lt;/p&gt;

&lt;p&gt;The issue is resolved by adding to the top of onResponse:&lt;/p&gt;

&lt;p&gt;            // acknowledge receipt of the event&lt;br/&gt;
            Object source = responseEvent.getSource();&lt;br/&gt;
            ((Snmp)source).cancel(responseEvent.getRequest(), this);&lt;/p&gt;

&lt;p&gt;which is recommended by the API docs:&lt;/p&gt;

&lt;p&gt;public void onResponse(ResponseEvent event) &lt;/p&gt;
{
       // Always cancel async request when response has been received
       // otherwise a memory leak is created! Not canceling a request
       // immediately can be useful when sending a request to a broadcast
       // address.
       ((Snmp)event.getSource()).cancel(event.getRequest(), this);
       System.out.println(&quot;Received response PDU is: &quot;+event.getResponse());
     }

&lt;p&gt;see &lt;a href=&quot;http://www.snmp4j.org/doc/org/snmp4j/Snmp.html&quot; class=&quot;external-link&quot; target=&quot;_blank&quot; rel=&quot;nofollow noopener&quot;&gt;http://www.snmp4j.org/doc/org/snmp4j/Snmp.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This causes the handler to call setResult.  Events continue to arrive however, resulting in the ConcurrentModificationException.&lt;/p&gt;</comment>
                            <comment id="53842" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:41:28 +0000"  >&lt;p&gt;Attached patch resolves the issue.  It also adds error logging so that the problem can be seen as it happens, rather than downstream (in this case the ConcurrentModificationException was not the root cause).  This will help in other cases where the response is null (timeouts).&lt;/p&gt;</comment>
                            <comment id="53844" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:44:56 +0000"  >&lt;p&gt;Attachment file_3921.txt has been added with description: patch to resolve issue&lt;/p&gt;</comment>
                    </comments>
                    <attachments>
                            <attachment id="13785" name="file_3921.txt" size="2877" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:44:56 +0000"/>
                            <attachment id="13784" name="testWalkRemote.rtf" size="2833" author="jon@ivydesign.com" created="Wed, 1 Jul 2015 17:31:21 +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_10208" key="com.atlassian.jira.plugin.system.customfieldtypes:textfield">
                        <customfieldname>External issue ID</customfieldname>
                        <customfieldvalues>
                            <customfieldvalue>3921</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=3921]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                            <customfield id="customfield_10206" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Issue Type</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10300"><![CDATA[Bug]]></customfieldvalue>

                        </customfieldvalues>
                    </customfield>
                                                                                                                                                                                                                                                                                                                                                                                                                                            <customfield id="customfield_10202" key="com.atlassian.jira.plugin.system.customfieldtypes:select">
                        <customfieldname>Priority</customfieldname>
                        <customfieldvalues>
                                <customfieldvalue key="10312"><![CDATA[High]]></customfieldvalue>

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

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