[BGPCEP-28] Too many files open exception from Netty with multiple netconf clients Created: 05/Nov/13  Updated: 03/Mar/19  Resolved: 14/Nov/13

Status: Resolved
Project: bgpcep
Component/s: General
Affects Version/s: Bugzilla Migration
Fix Version/s: Bugzilla Migration

Type: Bug
Reporter: Maros Marsalek Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


Attachments: Text File f.txt    
External issue ID: 133

 Description   

This issue is probably caused by using multiple instances of NioEventLoopGroup. With every new instance of org.opendaylight.protocol.framework.AbstractDispatcher, new NioEventLoopGroup is created.

According to: https://github.com/netty/netty/issues/639

Stack trace:

07:57:06.110 [main] ERROR o.o.c.n.impl.ConcurrentClientsTest - Thread for testing client failed
java.lang.IllegalStateException: failed to create a child event loop
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:61) ~[netty-common-4.0.10.Final.jar:na]
at io.netty.channel.MultithreadEventLoopGroup.<init>(MultithreadEventLoopGroup.java:49) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:61) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:52) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:44) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoopGroup.<init>(NioEventLoopGroup.java:36) ~[netty-transport-4.0.10.Final.jar:na]
at org.opendaylight.protocol.framework.AbstractDispatcher.<init>(AbstractDispatcher.java:58) ~[framework-0.3.0-SNAPSHOT.jar:na]
at org.opendaylight.controller.netconf.client.NetconfClientDispatcher.<init>(NetconfClientDispatcher.java:35) ~[netconf-client-0.2.2-SNAPSHOT.jar:na]
at org.opendaylight.controller.netconf.client.NetconfClient.<init>(NetconfClient.java:53) ~[netconf-client-0.2.2-SNAPSHOT.jar:na]
at org.opendaylight.controller.netconf.client.NetconfClient.<init>(NetconfClient.java:86) ~[netconf-client-0.2.2-SNAPSHOT.jar:na]
at org.opendaylight.controller.netconf.impl.ConcurrentClientsTest$TestingThread.run(ConcurrentClientsTest.java:265) ~[test-classes/:na]
Caused by: io.netty.channel.ChannelException: failed to open a new selector
at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:128) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoop.<init>(NioEventLoop.java:120) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.channel.nio.NioEventLoopGroup.newChild(NioEventLoopGroup.java:87) ~[netty-transport-4.0.10.Final.jar:na]
at io.netty.util.concurrent.MultithreadEventExecutorGroup.<init>(MultithreadEventExecutorGroup.java:57) ~[netty-common-4.0.10.Final.jar:na]
... 10 common frames omitted
Caused by: java.io.IOException: Too many open files
at sun.nio.ch.IOUtil.makePipe(Native Method) ~[na:1.7.0_25]
at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:65) ~[na:1.7.0_25]
at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:36) ~[na:1.7.0_25]
at io.netty.channel.nio.NioEventLoop.openSelector(NioEventLoop.java:126) ~[netty-transport-4.0.10.Final.jar:na]
... 13 common frames omitted



 Comments   
Comment by Maros Marsalek [ 05/Nov/13 ]

List acquired while runnig org.opendaylight.controller.netconf.impl.ConcurrentClientsTest using maven.

NOT using this patch: https://git.opendaylight.org/gerrit/#/c/2379/

-Dio.netty.eventLoopThreads=64

Comment by Maros Marsalek [ 05/Nov/13 ]

Attachment f.txt has been added with description: list of open files

Comment by Robert Varga [ 05/Nov/13 ]

This should be fixed by pushing the NIO group out and being provided by whoever is instantiating AbstractDispatcher.

Comment by Robert Varga [ 14/Nov/13 ]

Fixed as of 365d6585c96ae16d4e86cb035bc183c7207cc53c

Generated at Wed Feb 07 19:11:50 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.