Bug 56320

Summary: DefaultServlet leaks file handles
Product: Tomcat 8 Reporter: jfclere <jfclere>
Component: ConnectorsAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: regression    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description jfclere 2014-03-27 08:44:50 UTC
While running ab test against tomcat 8 I have the following failure:
+++
44714 27-Mar-2014 04:41:00.605 SEVERE [http-bio-8001-Acceptor-0] org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run Socket accept failed
244715  java.net.SocketException: Too many open files
244716         at java.net.PlainSocketImpl.socketAccept(Native Method)
244717         at java.net.AbstractPlainSocketImpl.accept(AbstractPlainSocketImpl.java:398)
244718         at java.net.ServerSocket.implAccept(ServerSocket.java:530)
+++
That doesn't depend on the connector.

And lsof says:
+++
[hudson@messaging-09 tc8]$ lsof | grep ROOT | wc -l
32667
[hudson@messaging-09 tc8]$ lsof | grep ROOT | grep 64KiB.bin | wc -l
32667
+++

64KiB.bin is the file I am requesting in ab.
Comment 1 jfclere 2014-03-27 09:18:18 UTC
In fact it seems it is linked with sendfile.
Comment 2 Mark Thomas 2014-03-27 16:59:58 UTC
Thanks for the report. I've fixed this in trunk and it will be included in 8.0.6 onwards.