user2508922
user2508922

Reputation: 83

Netty4 Unexpected exception in the selector loop

I have implemented a HTTP client using Netty4.0.0.CR3. I am managing a pool of client connection toward server, Based on certain event an event handler thread pick one connection from the pool, send the HTTP request to server, wait for response (FullHttpResponse) and then release connection back to pool.

Now problem which I am facing is that under heavy load I am getting these warnings in my log, `

15:56:59.828 nioEventLoopGroup-37-1 WARN i.n.c.nio.NioEventLoop - Slf4JLogger.warn() : Unexpected exception in the selector loop. java.util.concurrent.RejectedExecutionException: event executor terminated at io.netty.util.concurrent.SingleThreadEventExecutor.reject(SingleThreadEventExecutor.java:711) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor.addTask(SingleThreadEventExecutor.java:306) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor.execute(SingleThreadEventExecutor.java:696) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.channel.AbstractChannel$AbstractUnsafe.invokeLater(AbstractChannel.java:968) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.channel.AbstractChannel$AbstractUnsafe.close(AbstractChannel.java:750) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.channel.nio.NioEventLoop.closeAll(NioEventLoop.java:521) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:329) ~[netty-all-4.0.0.CR3.jar:na] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:114) [netty-all-4.0.0.CR3.jar:na] at java.lang.Thread.run(Thread.java:680) [na:1.6.0_45]

`
Now, what i want to ask is, will these warnings will create any problem, if yes any pointers on how to solve this or I can ignore them.

Regards !!

Upvotes: 4

Views: 13891

Answers (1)

Norman Maurer
Norman Maurer

Reputation: 23557

I think you shutdown EventLoopGroup before all requests are handled. Be sure to use EventLoopGroup.shutdownGracefully().

If you shutdown the EventLoopGroup before everything is handled it will produce such an error

Upvotes: 4

Related Questions