https://issues.apache.org/bugzilla/show_bug.cgi?id=55772

--- Comment #1 from Seth P <seth.pellegr...@jivesoftware.com> ---
>From our analysis of the issue, the problem occurs because of
AbstractHttp11Processor's reentrancy via the Response object. From the
following stack trace:

java.io.IOException: Broken pipe
    at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
    at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
    at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:94)
    at sun.nio.ch.IOUtil.write(IOUtil.java:65)
    at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:450)
    at org.apache.tomcat.util.net.NioChannel.write(NioChannel.java:123)
    at
org.apache.tomcat.util.net.NioBlockingSelector.write(NioBlockingSelector.java:94)
    at
org.apache.tomcat.util.net.NioSelectorPool.write(NioSelectorPool.java:174)
    at
org.apache.coyote.http11.InternalNioOutputBuffer.writeToSocket(InternalNioOutputBuffer.java:163)
    at
org.apache.coyote.http11.InternalNioOutputBuffer.flushBuffer(InternalNioOutputBuffer.java:242)
    at
org.apache.coyote.http11.InternalNioOutputBuffer.flush(InternalNioOutputBuffer.java:94)
    at
org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:793)
    at org.apache.coyote.Response.action(Response.java:174)
    at
org.apache.catalina.connector.OutputBuffer.doFlush(OutputBuffer.java:359)
    at org.apache.catalina.connector.OutputBuffer.flush(OutputBuffer.java:326)
    at org.apache.catalina.connector.CoyoteWriter.flush(CoyoteWriter.java:98)
    ...
    <application code>
    ...
    at
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at
org.apache.coyote.AbstractProtocol.AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at
org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1686)
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)

The key insight is that the
AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023) frame near
the bottom is inside the same instance as the
AbstractHttp11Processor.action(AbstractHttp11Processor.java:793) frame near the
top. The latter sets the instance-level error flag as a result of the broken
pipe exception, causing the #process invocation to return SocketState.CLOSED.
Because the request is async, the CoyoteAdapter has not cleaned up the catalina
request in its finally block (the same object as referenced through
ADAPTER_NOTES as Todd describes), but the SocketState.CLOSED indicates to the
connection handler that the processor is ready for recycling (which does NOT
recycle the catalina request) and re-use.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org

Reply via email to