<!-- 
RSS generated by JIRA (8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d) at Wed Feb 07 19:54:20 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>[CONTROLLER-969] Multiple CLOSE_WAIT connections after unhandled memory exception during stress test</title>
                <link>https://jira.opendaylight.org/browse/CONTROLLER-969</link>
                <project id="10113" key="CONTROLLER">controller</project>
                    <description>&lt;p&gt;After a stress test scenario with kc-cbench tool, with a few thousands of&lt;br/&gt;
datapaths, a file descriptor leak is taking place due to closed_wait tcp connections. Problem is accumulative until JVM restart.&lt;/p&gt;

&lt;p&gt;Steps to reproduce &lt;/p&gt;

&lt;p&gt;1) Start only the sdn controller using run.sh&lt;br/&gt;
2) run a tool e.g. cbench -s 20000 (kc-cbench)to create thousands of tcp&lt;br/&gt;
   connections in port 6633 until you see the following error :&lt;/p&gt;

&lt;p&gt;   2014-10-29 10:46:20.146 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; ERROR o.o.c.l.b.i.UncaughtExceptionPolicy  - Thread Thread&lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread,5,main&amp;#93;&lt;/span&gt; died because of an uncaught exception&lt;br/&gt;
java.lang.OutOfMemoryError: Direct buffer memory&lt;/p&gt;

&lt;p&gt; NOTE:&lt;br/&gt;
   -The number of connections limit for the error to happen should vary depending on set JVM memory limit or could even not happen if e.g. osgi is not stressed a lot. &lt;br/&gt;
    Set JVM limit to &quot;-Xmx1G&quot; to avoid this.&lt;br/&gt;
   -The way kc-cbench sdn performance tool initiates the connections could play a role in this scenario so it is recommended for reproducing it.&lt;/p&gt;

&lt;p&gt;3) check with netstat -anp | grep 6633 &lt;br/&gt;
   Many connections stay in close wait state waiting for the controller &lt;br/&gt;
   to close them but due to the uncaught exception they remain open leading     to system resources leak (file descriptors). &lt;/p&gt;

&lt;p&gt;tcp6       1      0 127.0.0.1:6633          127.0.0.1:33466         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:50346         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:38301         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:48533         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:37408         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:53192         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:52902         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:34564         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:49069         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:56437         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:58956         CLOSE_WAIT &lt;br/&gt;
tcp6       1      0 127.0.0.1:6633          127.0.0.1:47915         CLOSE_WAIT &lt;/p&gt;


&lt;p&gt;******************************************************************************&lt;br/&gt;
...MANY SIMILAR MESSAGES FOR EACH CONNECTION&lt;br/&gt;
******************************************************************************&lt;br/&gt;
2014-10-29 10:46:19.650 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:60968 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.652 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:58972 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.653 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:51264 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.655 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:54264 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.656 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:36014 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.658 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:42616 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:19.659 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; INFO  o.o.c.p.o.core.internal.Controller  - Switch:127.0.0.1:50015 is connected to the Controller&lt;br/&gt;
2014-10-29 10:46:20.146 EET &lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread&amp;#93;&lt;/span&gt; ERROR o.o.c.l.b.i.UncaughtExceptionPolicy  - Thread Thread&lt;span class=&quot;error&quot;&gt;&amp;#91;ControllerI/O Thread,5,main&amp;#93;&lt;/span&gt; died because of an uncaught exception&lt;br/&gt;
java.lang.OutOfMemoryError: Direct buffer memory&lt;br/&gt;
	at java.nio.Bits.reserveMemory(Bits.java:658) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:1.7.0_67&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at java.nio.DirectByteBuffer.&amp;lt;init&amp;gt;(DirectByteBuffer.java:123) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:1.7.0_67&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at java.nio.ByteBuffer.allocateDirect(ByteBuffer.java:306) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:1.7.0_67&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.MessageReadWriteService.&amp;lt;init&amp;gt;(MessageReadWriteService.java:47) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.SwitchHandler.getMessageReadWriteService(SwitchHandler.java:826) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.SwitchHandler.setupCommChannel(SwitchHandler.java:812) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.SwitchHandler.start(SwitchHandler.java:149) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.Controller.handleNewConnection(Controller.java:247) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at org.opendaylight.controller.protocol_plugin.openflow.core.internal.ControllerIO$1.run(ControllerIO.java:90) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:na&amp;#93;&lt;/span&gt;&lt;br/&gt;
	at java.lang.Thread.run(Thread.java:745) ~&lt;span class=&quot;error&quot;&gt;&amp;#91;na:1.7.0_67&amp;#93;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;Possible solution :  &lt;br/&gt;
catch memory exception and close possible connections.&lt;br/&gt;
At closed_wait state client should have already sent FIN to controller but due to the exception, some connections are staying in this state since the controller did not have the time to close them and send FIN.&lt;/p&gt;</description>
                <environment>&lt;p&gt;Operating System: Linux&lt;br/&gt;
Platform: PC&lt;/p&gt;</environment>
        <key id="25523">CONTROLLER-969</key>
            <summary>Multiple CLOSE_WAIT connections after unhandled memory exception during stress test</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="10001">Won&apos;t Do</resolution>
                                        <assignee username="-1">Unassigned</assignee>
                                    <reporter username="ekontothanasis@yahoo.co.uk">EPAMEINONDAS KONTOTHANASIS</reporter>
                        <labels>
                    </labels>
                <created>Wed, 29 Oct 2014 11:03:45 +0000</created>
                <updated>Thu, 19 Oct 2017 21:27:07 +0000</updated>
                            <resolved>Thu, 19 May 2016 18:46:07 +0000</resolved>
                                    <version>Helium</version>
                                                    <component>adsal</component>
                        <due></due>
                            <votes>0</votes>
                                    <watches>3</watches>
                                                                                                                <comments>
                            <comment id="49645" author="carolsand@gmail.com" created="Mon, 4 May 2015 20:14:28 +0000"  >&lt;p&gt;This bug is part of the project to Move all ADSAL associated component bugs to ADSAL&lt;/p&gt;</comment>
                            <comment id="49646" author="rovarga" created="Thu, 19 May 2016 18:46:07 +0000"  >&lt;p&gt;AD-SAL has been removed, this issue will not be fixed.&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>2270</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=2270]]></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|i02nof:</customfieldvalue>

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