You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Adam Feuer <ad...@gmail.com> on 2007/11/28 19:50:06 UTC

Tomcat hangs on writing JSP page to socket

Folks,

We're getting intermittent problems where one tomcat thread hangs for up to
10 minutes writing JSP pages to a socket. We think the socket is an HTTP TCP
socket. The stack trace from a thread dump for the hung thread is below.

This happens multiple times per day at seemingly random intervals. We have
not been able to reproduce this reliably and has been happening for as long
as we have data (6+ months), so doesn't seem to be tied to a specific recent
change.

We run Struts 1.35, Tomcat 5.5.9, Linux 2.4.21 (Redhat) on four boxes behind
a Netscaler load balancer. All boxes exhibit the same problem at different
random intervals.

Has anyone seen this problem? If so, do you know of a fix?

-adam

Thread 18114: (state = IN_NATIVE)
 - java.net.SocketOutputStream.socketWrite0(java.io.FileDescriptor, byte[],
int, int) @bci=0 (Compiled frame; information may be imprecise)
 - java.net.SocketOutputStream.socketWrite (byte[], int, int) @bci=44,
line=92 (Compiled frame)
 - java.net.SocketOutputStream.write(byte[], int, int) @bci=4, line=136
(Compiled frame)
 - org.apache.coyote.Response.action(org.apache.coyote.ActionCode,
java.lang.Object ) @bci=31, line=182 (Compiled frame)
 - java.io.PrintWriter.flush() @bci=15, line=270 (Compiled frame)
 - org.apache.struts.tiles.taglib.InsertTag.doEndTag() @bci=18, line=462
(Interpreted frame)
 - org.apache.jsp.pages.SearchNarrowBy_jsp._jspx_meth_tiles_insert_0 (
javax.servlet.jsp.PageContext) @bci=50, line=724 (Interpreted frame)
 - org.apache.jsp.pages.SearchNarrowBy_jsp._jspService(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=286, line=120 (Compiled frame)
 - org.apache.jasper.runtime.HttpJspBase.service(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=3, line=97 (Interpreted frame)
 - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest ,
javax.servlet.ServletResponse) @bci=30, line=802 (Interpreted frame)
 - org.apache.jasper.servlet.JspServletWrapper.service(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean) @bci=186, line=322
(Compiled frame)
 - org.apache.jasper.servlet.JspServlet.serviceJspFile(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean) @bci=129, line=291 (Compiled frame)
 - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest,
javax.servlet.ServletResponse) @bci=30, line=802 (Compiled frame)
 - org.apache.catalina.core.ApplicationFilterChain.doFilter(
javax.servlet.ServletRequest , javax.servlet.ServletResponse) @bci=101,
line=173 (Compiled frame)
 - org.apache.catalina.core.ApplicationDispatcher.invoke(
javax.servlet.ServletRequest, javax.servlet.ServletResponse) @bci=396,
line=672 (Compiled frame)
 - org.apache.catalina.core.ApplicationDispatcher.doInclude(
javax.servlet.ServletRequest, javax.servlet.ServletResponse) @bci=368,
line=574 (Compiled frame)
 - org.apache.catalina.core.ApplicationDispatcher.include (
javax.servlet.ServletRequest, javax.servlet.ServletResponse) @bci=55,
line=499 (Compiled frame)
 - org.apache.jasper.runtime.JspRuntimeLibrary.include(
javax.servlet.ServletRequest, javax.servlet.ServletResponse,
java.lang.String , javax.servlet.jsp.JspWriter, boolean) @bci=45, line=966
(Compiled frame)
 - org.apache.jasper.runtime.PageContextImpl.doInclude(java.lang.String,
boolean) @bci=14, line=633 (Compiled frame)
 - sun.reflect.GeneratedMethodAccessor59.invoke (java.lang.Object,
java.lang.Object[]) @bci=71 (Interpreted frame)
 - sun.reflect.DelegatingMethodAccessorImpl.invoke(java.lang.Object,
java.lang.Object[]) @bci=6, line=25 (Compiled frame)
 - java.lang.reflect.Method.invoke (java.lang.Object, java.lang.Object[])
@bci=111, line=585 (Compiled frame)
 - org.apache.struts.tiles.taglib.InsertTag.doEndTag() @bci=18, line=462
(Interpreted frame)
 - org.apache.jsp.pages.SearchPageLayout_jsp._jspx_meth_tiles_insert_5 (
javax.servlet.jsp.PageContext) @bci=50, line=235 (Interpreted
frame)
 - org.apache.jsp.pages.SearchPageLayout_jsp._jspService(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=381, line=101 (Interpreted
frame)
 - org.apache.jasper.runtime.HttpJspBase.service(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse) @bci=3, line=97 (Interpreted frame)
 - javax.servlet.http.HttpServlet.service(javax.servlet.ServletRequest ,
javax.servlet.ServletResponse) @bci=30, line=802 (Interpreted frame)
 - org.apache.jasper.servlet.JspServletWrapper.service(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, boolean) @bci=186, line=322
(Compiled frame)
 - org.apache.jasper.servlet.JspServlet.serviceJspFile(
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, java.lang.String,
java.lang.Throwable, boolean) @bci=129, line=291 (Compiled frame)



-- 
Adam Feuer
adamfeuer1 at gmail dot com



-- 
Adam Feuer
adamfeuer1 at gmail dot com

Re: Tomcat hangs on writing JSP page to socket

Posted by Adam Feuer <ad...@gmail.com>.
On Nov 28, 2007 11:03 AM, Jim Cox <sh...@gmail.com> wrote:

> FWIW, I've noticed similar behavior, but in my case it is easy to
> reproduce:
>  1. use a browser to request a long-running and/or
> large-page-producing web page ;
>  2. abort the page load before it is done.
> At that point I see the HTTP response thread blocked writing to the
> (now closed) socket, with it timing out TCP-wise in about 8 min
> (Solaris box, Tomcat 5.0.19, JDK 1.4.2_13).
>

Jim,

We tried to reproduce the problem yesterday using this technique, after some
research showed others with that problem- stopping the page load while a
page is downloading doesn't cause problems on our systems, though. The
symptoms are similar- except that in our case, the user experiencing the
problem has to wait minutes for the page to load.

-adam
-- 
Adam Feuer
adamfeuer1 at gmail dot com

Re: Tomcat hangs on writing JSP page to socket

Posted by Jim Cox <sh...@gmail.com>.
On Nov 28, 2007 1:50 PM, Adam Feuer <ad...@gmail.com> wrote:
> Folks,
>
> We're getting intermittent problems where one tomcat thread hangs for up to
> 10 minutes writing JSP pages to a socket. We think the socket is an HTTP TCP
> socket. The stack trace from a thread dump for the hung thread is below.
>
> This happens multiple times per day at seemingly random intervals. We have
> not been able to reproduce this reliably and has been happening for as long
> as we have data (6+ months), so doesn't seem to be tied to a specific recent
> change.
>
> We run Struts 1.35, Tomcat 5.5.9, Linux 2.4.21 (Redhat) on four boxes behind
> a Netscaler load balancer. All boxes exhibit the same problem at different
> random intervals.
>
> Has anyone seen this problem? If so, do you know of a fix?
>
> -adam

FWIW, I've noticed similar behavior, but in my case it is easy to reproduce:
  1. use a browser to request a long-running and/or
large-page-producing web page ;
  2. abort the page load before it is done.

At that point I see the HTTP response thread blocked writing to the
(now closed) socket, with it timing out TCP-wise in about 8 min
(Solaris box, Tomcat 5.0.19, JDK 1.4.2_13).

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org