[OPNFLWPLUG-507] OFHandshake thread leak leads to OOM Created: 17/Jun/15  Updated: 27/Sep/21  Resolved: 19/Jun/15

Status: Resolved
Project: OpenFlowPlugin
Component/s: General
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Jamo Luhrsen Assignee: Anil Vishnoi
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 3794

 Description   

this is similar to the following fixed bugs:
https://bugs.opendaylight.org/show_bug.cgi?id=2394
https://bugs.opendaylight.org/show_bug.cgi?id=2429

The 2429 issue has CI that is passing, so this is another flavor. The quickest way to reproduce this would be to install odl-openflowplugin-southbound and then execute this linux tool from another system:

for i in

{1..40000}

; do nc -w 0 <controller> 6633; done;

that will very quickly (to make this a fast reproduction) open and close
40k TCP connections on port 6633 to the controller.

you can get a thread count with this command:

ps --no-headers -o nlwp <controller PID>

after some time, you can see that the TCP connections are not maintained on the controller (which is what we expect):

netstat -na | grep 6633

after aprox 4-5m you should see an OutOfMemoryError.

with a debugger, you can see that OFHandshake threads are hanging around.

if you want to be nicer with the test, you can use a non-zero value for the 'nc' command above. Using 1, you can get one TCP connection open/closed every second and watch the thread count increase.

This was done on the 6/17 RC1 build for Lithium.



 Comments   
Comment by Anil Vishnoi [ 19/Jun/15 ]

https://git.opendaylight.org/gerrit/#/c/22994/2

Comment by Jamo Luhrsen [ 19/Jun/15 ]

verified with the distribution created by the merge job of the patch 22994

Generated at Wed Feb 07 20:32:40 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.