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 004fe8b  Fix regular read taking over async reads
004fe8b is described below

commit 004fe8bbab588b97b61f0bb03726deb379d0227b
Author: remm <r...@apache.org>
AuthorDate: Fri Mar 15 15:19:13 2019 +0100

    Fix regular read taking over async reads
    
    A call to registerReadInterest with the right timing could cause a
    regular read to occur, preventing the use of vectored IO. This is
    exhibited in the very elusive client timeout failure seen on CI, for
    example here in build #4128:
    
https://ci.apache.org/projects/tomcat/tomcat9/logs/4128/TEST-org.apache.coyote.http2.TestHttp2Section_6_7.NIO2.txt
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java | 2 ++
 webapps/docs/changelog.xml                        | 8 ++++++++
 2 files changed, 10 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index edfd10e..c49c209 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -984,6 +984,8 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint<Nio2Channel,AsynchronousS
             if (timeout == -1) {
                 timeout = toNio2Timeout(getReadTimeout());
             }
+            // Disable any regular read notifications caused by 
registerReadInterest
+            readNotify = true;
             if (block != BlockingMode.NON_BLOCK) {
                 try {
                     if (!readPending.tryAcquire(timeout, unit)) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index ecfb116..2e73125 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -76,6 +76,14 @@
       </fix>
     </changelog>
   </subsection>
+  <subsection name="Coyote">
+    <changelog>
+      <fix>
+        Fix bad interaction between NIO2 async read API and the regular read.
+        (remm)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Web applications">
     <changelog>
       <fix>


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

Reply via email to