tomcat-dev mailing list archives

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4361>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4361
SsiServlet potentially leaks files
Summary: SsiServlet potentially leaks files
Product: Tomcat 4
Version: 4.0 Final
Platform: Sun
OS/Version: Linux
Status: NEW
Severity: Critical
Priority: Other
Component: Catalina
AssignedTo: tomcat-dev@jakarta.apache.org
ReportedBy: rami.hanninen@davisor.com
SsiServlet does not seem to close some of the streams it uses. The symptoms this
causes are that the whole server starts to suffer from 'Too many open files'
errors like this:
2001-10-23 12:00:16 ApplicationDispatcher[/archive] Servlet.service() for
servlet default threw exception
java.io.FileNotFoundException: /home/ibs/archive/tk/tyyli_yleinen_ibs.ssi (Too
many open files)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:64)
at java.io.FileInputStream.<init>(FileInputStream.java:95)
at
org.apache.naming.resources.FileDirContext$FileResource.streamContent(FileDirContext.java)
at
org.apache.catalina.servlets.DefaultServlet$ResourceInfo.getStream(DefaultServlet.java)
at org.apache.catalina.servlets.DefaultServlet.copy(DefaultServlet.java)
at
org.apache.catalina.servlets.DefaultServlet.serveResource(DefaultServlet.java)
at org.apache.catalina.servlets.DefaultServlet.doGet(DefaultServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java)
at
org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java)
at
org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java)
at org.apache.catalina.util.ssi.SsiInclude.getStream(Unknown Source)
at org.apache.catalina.servlets.SsiInvokerServlet.requestHandler(Unknown
Source)
at org.apache.catalina.servlets.SsiInvokerServlet.doGet(Unknown Source)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at javax.servlet.http.HttpServlet.service(HttpServlet.java)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java)
at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java)
at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java)
at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java)
at java.lang.Thread.run(Thread.java:484)
Although this error message alone does not prove that SSI is the guilty party,
the errors started to appear immediately after SSI servlet was taken into use.
In particular, I tested the system with a lengthly data import operation that
accesses thousands of HTML documents, and it works fine when SSI is disabled,
but corrupts the server with the "Too many open files" problems when SSI is
enabled.
SSI implementation seems therefore to have at least some role in causing this
trouble.