Netty Boss IO Thread dies

이희승 (Trustin Lee) trustin at gmail.com
Tue Aug 16 05:05:21 EDT 2011


Hi,

Please do not specify a fixed thread pool when you construct a ChannelFactory. Specify Executors.newCachedThreadPool() - then Netty will pull only small number of threads.

I'm not sure why the boss thread dies, but was there any exception logged or printed out to stderr? 

-- 
Trustin Lee (http://gleamynode.net/)

On Sunday, August 14, 2011 at 1:52 AM, deinlandel wrote:

> Hi, All.
> 
> I have Netty-based server application with around 1000 clients who connect
> and disconnect frequently.
> 
> I use server bootstrap which is created as follows:
> <code>
> public static void main(String[] args) {
> //....some initialization code.....
>  ServerBootstrap bootstrap = new ServerBootstrap(new
> NioServerSocketChannelFactory(
>  Executors.newFixedThreadPool(Settings.getDemuxPoolSize()),
>  Executors.newFixedThreadPool(Settings.getDemuxPoolSize()), 
> Settings.getDemuxPoolSize()));
>  bootstrap.setPipelineFactory(pipelineFactory);
>  bootstrap.setOption("child.tcpNoDelay", true);
>  InetSocketAddress addr = new InetSocketAddress(address, port);
>  bootstrap.bind(addr);
> }
> </code>
> 
> The problem is my server app stops accepting new connections periodically,
> so I have to restart it.
> I've made a thread dump, analyzed it and found no "NIO Boss thread", which
> accepts connections!
> It seems that this thread has crashed.
> 
> Unfortunately, this is happening once per 5-6 hours, so it's hard to
> reproduce. So my question is: what can cause death of the "NIO Boss thread"
> (I thought that it never dies unless I shutdown Netty server bootstrap) and
> how can I prevent it?
> 
> I have no other pointers to server bootstrap. Can garbage collection of this
> object cause shutdown of NIO boss thread?
> 
> Any help will be appreciated.
> 
> P.S. Sorry for my bad English.
> 
> --
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Netty-Boss-IO-Thread-dies-tp6683480p6683480.html
> Sent from the Netty User Group mailing list archive at Nabble.com (http://Nabble.com).
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org (mailto:netty-users at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110816/b08d9080/attachment.html 


More information about the netty-users mailing list