java.io.IOException: Too many open files in JBoss EAP 7.0
Environment
- Red Hat JBoss Enterprise Application Platform (EAP)
- 7.0
Issue
Occasionally, the following java.io.IOException: Too many open files occurs:
2018-07-04 20:45:50,318 WARN [org.jboss.modcluster] (UndertowEventHandlerAdapter - 1)
2018-07-04 20:46:50,452 ERROR [org.xnio.nio.tcp.server] (default Accept) Exception accepting request, closing server channel TCP server (NIO) <7e6f914c>: java.io.IOException: Too many open files
at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:422)
at sun.nio.ch.ServerSocketChannelImpl.accept(ServerSocketChannelImpl.java:250)
at org.xnio.nio.QueuedNioTcpServer.handleReady(QueuedNioTcpServer.java:476)
at org.xnio.nio.QueuedNioTcpServerHandle.handleReady(QueuedNioTcpServerHandle.java:38)
at org.xnio.nio.WorkerThread.run(WorkerThread.java:571)
Resolution
Upgrade to JBoss EAP 7.1 or the latest.
However, if updating to the last version of JBoss EAP 7.1 does not solve this issue try increasing the jboss user open files as a temporary approach solve this issue, similarly to the process described in How to correct the error "Too many files open" on Red Hat Enterprise Linux and How to set ulimit values:
ulimit -n <number_of_open_files>
After a limits.conf change, it is necessary logout and logging, in other words, exit and re-login from the terminal for the change to take effect, as described on the solution How to set ulimit values.
Root Cause
There is a known issue related to XNIO, This content is not included.XNIO-286. The issue was fixed in version 3.5.4.Final included in Jboss EAP 7.1. Updating to a version JBoss EAP 7.1 or later, can solve it, therefore. The error might not always occur, depending on the other processes' usage of files at the moment.
Diagnostic Steps
Verify the current limit of files of the jboss user in the lsof.out to confirm if the limit is low, e.g 1024, which is not a very adequate value for file management in a production server.
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.