Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Netty4 Unexpected exception in the selector loop

Tags:

java

netty

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 !!

like image 495
user2508922 Avatar asked Oct 21 '25 17:10

user2508922


1 Answers

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

like image 102
Norman Maurer Avatar answered Oct 24 '25 08:10

Norman Maurer



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!