tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Cherichetti \(Renegade Internet\)" <m...@renegadeinternet.com>
Subject RE: Bug in ErrorDispatcherValue?
Date Fri, 05 Sep 2003 16:22:20 GMT
After debugging this further, I've figured out what's going on here.  I was
calling two methods after committing the response that process some optional
logging to a backend database and submit a record to a queue that later gets
processed by a background thread in batches.  Both of those methods access
the HttpSession to get various peices of information out of it, which
appears to be a problem when using the PersistentManager to store sessions
in a database.  I noticed some errors like this spawing from one of those
methods:

java.lang.IllegalStateException: getAttribute: Session already invalidated
        at
org.apache.catalina.session.StandardSession.getAttribute(StandardSession.jav
a(Compiled Code))
        at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java(Compiled Code))
        at
org.apache.catalina.session.StandardSessionFacade.getAttribute(StandardSessi
onFacade.java(Compiled Code))
... snip ...

I'm guessing the session was swapped out of memory right after the request
occurred?  Doesn't seem to make sense because I have the swap out set to
happen after 1 minute of inactivity.  This is the best possible explanation
I could come up with for the exceptions though.  Maybe a problem with the
PersistentManager swapping out a session when processing hasn't left the
service() method?

Still, I think there may be a problem with the ErrorDispatcherValve.  It
shouldn't be trying to process an error response after the response has
already been committed should it?  Maybe I'm only seeing this because I've
disabled keep alive connections.

Anyone have any input?  Should I submit something as a bug here?

Thanks,
Mike

-----Original Message-----
From: Mike Cherichetti (Renegade Internet)
[mailto:mike@renegadeinternet.com]
Sent: Friday, September 05, 2003 10:06 AM
To: Tomcat Users
Subject: Bug in ErrorDispatcherValue?


I've had this happen twice in the past two days on two rather busy servers.
Both are running RedHat Linux 7.3, IBM JDK 1.4.1, and Tomcat 4.1 (one is
4.1.24 and the other is 4.1.27).  After these exceptions hit the error log,
Tomcat stops responding:


2003-09-05 06:33:06 ErrorDispatcherValve[www.mysite.com]: Exception
Processing ErrorPage[errorCode=500, location=/error/500.jsp]
java.net.SocketException: Broken pipe
        at java.net.SocketOutputStream.socketWrite0(Native Method)
        at
java.net.SocketOutputStream.socketWrite(SocketOutputStream.java(Compiled
Code))
        at
java.net.SocketOutputStream.write(SocketOutputStream.java(Compiled Code))
        at
org.apache.coyote.http11.InternalOutputBuffer$OutputStreamOutputBuffer.doWri
te(InternalOutputBuffer.java(Compiled Code))
        at
org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFi
lter.java(Compiled Code))
        at
org.apache.coyote.http11.InternalOutputBuffer.doWrite(InternalOutputBuffer.j
ava(Compiled Code))
        at
org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java(Compiled
Code))
        at
org.apache.coyote.tomcat4.OutputBuffer.flush(OutputBuffer.java(Compiled
Code))
        at
org.apache.coyote.tomcat4.CoyoteResponse.flushBuffer(CoyoteResponse.java:555
)
        at
org.apache.coyote.tomcat4.CoyoteResponseFacade.flushBuffer(CoyoteResponseFac
ade.java:227)
        at
org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve.
java(Compiled Code))
        at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java(Compiled Code))
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
        at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Com
piled Code))
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi
led Code))
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled
Code))
        at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
(Compiled Code))
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
        at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi
led Code))
        at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled
Code))
        at
org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java(Compiled
Code))
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java(Compil
ed Code))
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java(Compiled Code))
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java(Compil
ed Code))
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a(Compiled Code))
        at java.lang.Thread.run(Thread.java(Compiled Code))


2003-09-04 15:42:54 ErrorDispatcherValve[localhost]: Exception Processing
ErrorPage[errorCode=500, location=/error/500.jsp]
java.lang.IllegalStateException: Cannot reset after response has been
committed
 at org.apache.catalina.connector.ResponseBase.reset(ResponseBase.java:789)
 at
org.apache.catalina.connector.HttpResponseBase.reset(HttpResponseBase.java:8
12)
 at
org.apache.catalina.connector.HttpResponseBase.reset(HttpResponseBase.java:3
73)
 at
org.apache.catalina.valves.ErrorDispatcherValve.custom(ErrorDispatcherValve.
java:413)
 at
org.apache.catalina.valves.ErrorDispatcherValve.status(ErrorDispatcherValve.
java(Compiled Code))
 at
org.apache.catalina.valves.ErrorDispatcherValve.throwable(ErrorDispatcherVal
ve.java:277)
 at
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.
java(Compiled Code))
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
 at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java(Com
piled Code))
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi
led Code))
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled
Code))
 at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java
(Compiled Code))
 at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invok
eNext(StandardPipeline.java(Compiled Code))
 at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java(Compi
led Code))
 at
org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java(Compiled
Code))
 at
org.apache.ajp.tomcat4.Ajp13Processor.process(Ajp13Processor.java(Compiled
Code))
 at org.apache.ajp.tomcat4.Ajp13Processor.run(Ajp13Processor.java:585)
 at java.lang.Thread.run(Thread.java:568)


That second exception is probably something that I should fix on my end.
But, I figured I would provide it too since it did cause a lockup too.
Anyone have an input?

Thanks,
Mike




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org






Mime
View raw message