Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resurfaced "java.io.IOException: Too many open files" when hit by multiple requests issue #1731

Closed
tomassommar opened this issue Aug 12, 2013 · 4 comments

Comments

@tomassommar
Copy link

This has previously been reported in issue 1578: #1578

The issue was set as resolved in 4.0.2.Final, but now exists in 4.0.6.Final.

Do you have any advice on this issue?

@lw346
Copy link
Member

lw346 commented Aug 12, 2013

Is the error being logged in an exceptionCaught, or is it causing the server to crash? Do you have a stacktrace?

@tomassommar
Copy link
Author

Yes, the error is logged in an exceptionCaught. It is not causing the server to crash, but the request to not to be processed.

Stack trace:

2013-08-12 06:36:31 WARN  DefaultChannelPipeline:953 - An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception.
java.io.IOException: Too many open files
        at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:152)
        at io.netty.channel.socket.nio.NioServerSocketChannel.doReadMessages(NioServerSocketChannel.java:111)
        at io.netty.channel.nio.AbstractNioMessageChannel$NioMessageUnsafe.read(AbstractNioMessageChannel.java:70)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:497)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:465)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:359)
        at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:101)
        at java.lang.Thread.run(Thread.java:662)

If the request can't be processed (or queued for later processing), a suggestion is to instead throw an exception signaling a HTTP 503 Service Unavailable response.

@lw346
Copy link
Member

lw346 commented Aug 12, 2013

This is expected behaviour, and is nothing that can be changed. The JVM is signalling that it is unable to accept the channel - therefore no connection can be initiated and no response can be sent. The client will see a connection failure. If you have a load-balancer, it should retry against an alternate host, or return the 503 on your application's behalf.

@lw346 lw346 closed this as completed Aug 12, 2013
@johnwonder
Copy link

i have this issue now ,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants