[undertow-dev] leaking file descriptors when using classpath resource

Stuart Douglas sdouglas at redhat.com
Tue May 23 18:51:30 EDT 2017


Looks like a bug: https://issues.jboss.org/browse/UNDERTOW-1081

This will be fixed in 1.4.16.Final

Stuart

On Tue, May 23, 2017 at 8:14 PM, Sascha Sadat-Guscheh <kid at bitkid.com> wrote:
> Hello!
>
> We pack our undertow application into a fatJar and we want to serve some resources out of that jar file. Currently we initialise our handler like this:
>
> Handlers.resource(ClassPathResourceManager(ClassLoader.getSystemClassLoader(), "public/“))
>
> It works, but for each call we do it opens a file descriptor to the jar and it never closes it so we end up pretty soon with a TooManyOpenFiles exception.
>
> 2017-05-22 14:20:24,542 Exception accepting request, closing server channel TCP server (NIO) <33364501> 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:477)
>     at org.xnio.nio.QueuedNioTcpServerHandle.handleReady(QueuedNioTcpServerHandle.java:38)
>     at org.xnio.nio.WorkerThread.run(WorkerThread.java:567)
>
> Are we using it wrong?
>
> Best, Sascha
> _______________________________________________
> undertow-dev mailing list
> undertow-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/undertow-dev



More information about the undertow-dev mailing list