This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 7040497  Add sync when processing asynchronous operation in NIO
7040497 is described below

commit 7040497fa564c63d8eba4ffc7d4c6e58cbccc369
Author: remm <r...@apache.org>
AuthorDate: Mon May 6 15:36:36 2019 +0200

    Add sync when processing asynchronous operation in NIO
    
    The NIO poller seems to create some unwanted concurrency, causing rare
    CI test failures that for whatever reason did not show up before 9.0.20.
    #4293 and #4297 show thread safety related buffer corruption which as
    far as I can tell can only occur through the poller. It doesn't seem
    right to me that there is concurrency here, but it's not hard to add a
    sync.
---
 java/org/apache/tomcat/util/net/NioEndpoint.java | 2 +-
 webapps/docs/changelog.xml                       | 9 +++++++++
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java 
b/java/org/apache/tomcat/util/net/NioEndpoint.java
index 259dc64..11b20b2 100644
--- a/java/org/apache/tomcat/util/net/NioEndpoint.java
+++ b/java/org/apache/tomcat/util/net/NioEndpoint.java
@@ -1517,7 +1517,7 @@ public class NioEndpoint extends 
AbstractJsseEndpoint<NioChannel,SocketChannel>
             }
 
             @Override
-            public void run() {
+            public synchronized void run() {
                 // Perform the IO operation
                 // Called from the poller to continue the IO operation
                 long nBytes = 0;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 872b5c4..74743a0 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -52,6 +52,15 @@
       </add>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        NIO poller seems to create some unwanted concurrency, causing rare
+        CI test failures. Add sync when processing async operation to avoid
+        this. (remm)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Other">
     <changelog>
       <update>


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

Reply via email to