Bug 58400

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

Description Yilong Li 2015-09-12 17:27:31 UTC
Reported by RV-Predict (a dynamic race detector) when running the test suite:
Data race on field org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.cometNotify: {{{
    Concurrent write in thread T30 (locks held: {})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.setCometNotify(NioEndpoint.java:1359)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:620)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.cancelledKey(NioEndpoint.java:965)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.processKey(NioEndpoint.java:1117)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:1316)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1056)
    T30 is created by T1
        at org.apache.tomcat.util.net.NioEndpoint.startInternal(NioEndpoint.java:426)

    Concurrent write in thread T37 (locks held: {Monitor@3d2263f5})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.setCometNotify(NioEndpoint.java:1359)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:620)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:903)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:890)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:259)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:722)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
        - locked Monitor@3d2263f5 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1481)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T37 is created by T30
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}} 

Data race on field org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.cometNotify: {{{
    Concurrent read in thread T30 (locks held: {})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.getCometNotify(NioEndpoint.java:1360)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.timeout(NioEndpoint.java:1291)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:1056)
    T30 is created by T1
        at org.apache.tomcat.util.net.NioEndpoint.startInternal(NioEndpoint.java:426)

    Concurrent write in thread T37 (locks held: {Monitor@3d2263f5})
 ---->  at org.apache.tomcat.util.net.NioEndpoint$KeyAttachment.setCometNotify(NioEndpoint.java:1359)
        at org.apache.tomcat.util.net.NioEndpoint.processSocket(NioEndpoint.java:620)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:903)
        at org.apache.tomcat.util.net.NioEndpoint$Poller.add(NioEndpoint.java:890)
        at org.apache.coyote.http11.Http11NioProtocol$Http11ConnectionHandler.longPoll(Http11NioProtocol.java:259)
        at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:722)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1526)
        at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1482)
        - locked Monitor@3d2263f5 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1481)
        at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    T37 is created by T30
        at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:1010)
}}}
Comment 1 Mark Thomas 2015-09-18 09:00:42 UTC

*** This bug has been marked as a duplicate of bug 58396 ***