YoK
YoK

Reputation: 14505

ClosedChannelException observered with netty 3.2.7 and 3.3.1 under load

Every thing is working fine when my netty server is not loaded. But under load it starts to fail. Currently I am using all default settings ( have not set any options ). Please suggest if I need to set any options for handling 2k+ concurrent connections (may close and open very frequently during load)

Here is stack trace with netty 3.2.7. I upgraded to netty 3.3.1 , but it still fails.

2012-09-19 16:17:54,864 New I/O server worker #1-11 DEBUG org.jboss.netty.handler.ssl.SslHandler 42 Swallowing an exception raised while writing non-app data java.nio.channels.ClosedChannelException: null at org.jboss.netty.channel.socket.nio.NioWorker.cleanUpWriteBuffer(NioWorker.java:645) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.writeFromUserCode(NioWorker.java:372) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.handleAcceptedSocket(NioServerSocketPipelineSink.java:137) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioServerSocketPipelineSink.eventSunk(NioServerSocketPipelineSink.java:76) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.Channels.write(Channels.java:632) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.Channels.write(Channels.java:593) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:831) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:915) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.ssl.SslHandler.wrapNonAppData(SslHandler.java:849) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:915) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.ssl.SslHandler.decode(SslHandler.java:620) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.codec.frame.FrameDecoder.callDecode(FrameDecoder.java:282) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.handler.codec.frame.FrameDecoder.messageReceived(FrameDecoder.java:216) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:274) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.Channels.fireMessageReceived(Channels.java:261) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.read(NioWorker.java:351) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.processSelectedKeys(NioWorker.java:282) ~[netty-3.2.7.Final.jar:na] at org.jboss.netty.channel.socket.nio.NioWorker.run(NioWorker.java:202) ~[netty-3.2.7.Final.jar:na] at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) [na:1.6.0_26] at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [na:1.6.0_26] at java.lang.Thread.run(Unknown Source) [na:1.6.0_26]

Upvotes: 3

Views: 2532

Answers (2)

Stuart Dabbs Halloway
Stuart Dabbs Halloway

Reputation: 1666

I believe that this problem may be caused by a bug in netty. I have created a reproducible test case here, and the bug is now fixed on the 3 branch of netty.

Upvotes: 1

user207421
user207421

Reputation: 311023

ClosedChannelException means you have continued to use a channel that you have closed yourself. Note that it does not refer to the state of the connection as affected by the peer: i.e. it does not imply that the peer has closed the connection. You have closed this channel.

Upvotes: 0

Related Questions