Bug 58377 - Data race on field org.apache.coyote.http11.AbstractHttp11Processor.keepAlive
Data race on field org.apache.coyote.http11.AbstractHttp11Processor.keepAlive
Status: RESOLVED FIXED
Product: Tomcat 8
Classification: Unclassified
Component: Catalina
8.0.x-trunk
PC Linux
: P2 normal (vote)
: ----
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2015-09-12 07:45 UTC by Yilong Li
Modified: 2015-09-14 20:23 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yilong Li 2015-09-12 07:45:00 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.coyote.http11.AbstractHttp11Processor.keepAlive: {{{
    Concurrent write in thread T39 (locks held: {})
 ---->  at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:1547)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:740)
        at org.apache.coyote.Response.action(Response.java:179)
        at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:249)
        at org.apache.coyote.Response.doWrite(Response.java:503)
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:388)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:315)
        at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:418)
        at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:406)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:97)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:90)
        at org.apache.catalina.connector.TestCoyoteAdapter$AsyncServlet$1.run(TestCoyoteAdapter.java:387)
    T39 is created by T38
        at org.apache.catalina.connector.TestCoyoteAdapter$AsyncServlet.doGet(TestCoyoteAdapter.java:409)

    Concurrent read in thread T38 (locks held: {Monitor@c32a9c3})
 ---->  at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1097)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
        - locked Monitor@c32a9c3 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:259) 
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T38 is created by T36
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}


Data race on field org.apache.coyote.http11.AbstractHttp11Processor.keepAlive: {{{
    Concurrent write in thread T39 (locks held: {})
 ---->  at org.apache.coyote.http11.AbstractHttp11Processor.prepareResponse(AbstractHttp11Processor.java:1547)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:740)
        at org.apache.coyote.Response.action(Response.java:179)
        at org.apache.coyote.http11.AbstractOutputBuffer.doWrite(AbstractOutputBuffer.java:249)
        at org.apache.coyote.Response.doWrite(Response.java:503)
        at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:388)
        at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:315)
        at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:418)
        at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:406)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:97)
        at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:90)
        at org.apache.catalina.connector.TestCoyoteAdapter$AsyncServlet$1.run(TestCoyoteAdapter.java:387)
    T39 is created by T38
        at org.apache.catalina.connector.TestCoyoteAdapter$AsyncServlet.doGet(TestCoyoteAdapter.java:409)

    Concurrent read in thread T38 (locks held: {Monitor@c32a9c3})
 ---->  at org.apache.coyote.http11.Http11Processor.breakKeepAliveLoop(Http11Processor.java:190)
        at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1172)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:673)
        at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:277)
        - locked Monitor@c32a9c3 at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:259) 
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T38 is created by T36
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}
Comment 1 Mark Thomas 2015-09-14 20:23:38 UTC
This has been fixed in trunk and 8.0.x for 8.0.27 onwards.