You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/03/15 14:26:55 UTC

[tomcat] branch 8.5.x updated: Fix regular read taking over async reads

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

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


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 644779a  Fix regular read taking over async reads
644779a is described below

commit 644779a166667ec8a82268238b6f3e0fbfae014b
Author: remm <re...@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 fd19475..dcd9bb9 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -958,6 +958,8 @@ public class Nio2Endpoint extends AbstractJsseEndpoint<Nio2Channel> {
             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 5c2eb41..79c2636 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-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org