Bug 58396

Summary: Data race on field org.apache.tomcat.util.net.NioEndpoint$Poller.nextExpiration
Product: Tomcat 8 Reporter: Yilong Li <yilong.li>
Component: UtilAssignee: Tomcat Developers Mailing List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 8.0.x-trunk   
Target Milestone: ----   
Hardware: PC   
OS: Linux   

Description Yilong Li 2015-09-12 17:10:52 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.tomcat.util.net.NioEndpoint$Poller.nextExpiration: {{{
    Concurrent write in thread T19 (locks held: {Monitor@684fa488})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:898)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:609)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:865)
        at org.apache.coyote.Request.action(Request.java:378)
        at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:231)
        - locked Monitor@684fa488 at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:192)
        at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:187)
        at org.apache.catalina.core.TestAsyncContextImpl$DispatchingServlet$1.run(TestAsyncContextImpl.java:710)
    T19 is created by T18
        at org.apache.catalina.core.TestAsyncContextImpl$DispatchingServlet.doGet(TestAsyncContextImpl.java:715)

    Concurrent read in thread T16 (locks held: {})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:1275)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1092)
    T16 is created by T1
        at org.apache.tomcat.util.net.NioEndpoint.startInternal(NioEndpoint.java:426)
}}} 

Data race on field org.apache.tomcat.util.net.NioEndpoint$Poller.nextExpiration: {{{
    Concurrent write in thread T19 (locks held: {Monitor@684fa488})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:898)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:609)
        at org.apache.coyote.http11.AbstractHttp11Processor.action(AbstractHttp11Processor.java:865)
        at org.apache.coyote.Request.action(Request.java:378)
        at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:231)
        - locked Monitor@684fa488 at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:192)
        at org.apache.catalina.core.AsyncContextImpl.dispatch(AsyncContextImpl.java:187)
        at org.apache.catalina.core.TestAsyncContextImpl$DispatchingServlet$1.run(TestAsyncContextImpl.java:710)
    T19 is created by T18
        at org.apache.catalina.core.TestAsyncContextImpl$DispatchingServlet.doGet(TestAsyncContextImpl.java:715)

    Concurrent read in thread T16 (locks held: {})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:1337)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1092)
    T16 is created by T1
        at org.apache.tomcat.util.net.NioEndpoint.startInternal(NioEndpoint.java:426)
}}}
Comment 1 Mark Thomas 2015-09-17 21:09:54 UTC
This was already fixed in trunk due to the connector clean-up. I've back-ported tjhe fix to 8.0.x for 8.0.27 onwards.
Comment 2 Mark Thomas 2015-09-18 09:00:42 UTC
*** Bug 58400 has been marked as a duplicate of this bug. ***