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

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


The following commit(s) were added to refs/heads/10.1.x by this push:
     new 6863a909fd 66482: Restore inline state after async operation in NIO2
6863a909fd is described below

commit 6863a909fd15eed3079dd7de8bb8877e1b39b6d1
Author: remm <r...@apache.org>
AuthorDate: Mon Feb 27 13:24:49 2023 +0100

    66482: Restore inline state after async operation in NIO2
    
    Patch submitted by zhougang.
---
 java/org/apache/tomcat/util/net/Nio2Endpoint.java | 7 +++++--
 webapps/docs/changelog.xml                        | 5 +++++
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/Nio2Endpoint.java 
b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
index f22c64abcc..3196247af1 100644
--- a/java/org/apache/tomcat/util/net/Nio2Endpoint.java
+++ b/java/org/apache/tomcat/util/net/Nio2Endpoint.java
@@ -1028,8 +1028,11 @@ public class Nio2Endpoint extends 
AbstractJsseEndpoint<Nio2Channel,AsynchronousS
                     writeNotify = true;
                 }
                 Nio2Endpoint.startInline();
-                run();
-                Nio2Endpoint.endInline();
+                try {
+                    run();
+                } finally {
+                    Nio2Endpoint.endInline();
+                }
             }
 
             @Override
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index a434ef8b3f..a05a3bd4fd 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -143,6 +143,11 @@
         Add a check for the validity of the scheme pseudo-header in HTTP/2.
         (markt)
       </add>
+      <fix>
+        <bug>66482</bug>: Restore inline state after async operation in NIO2,
+        to account the fact that unexpected exceptions are sometimes thrown
+        by the implementation. Patch submitted by zhougang. (remm)
+      </fix>
     </changelog>
   </subsection>
 </section>


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

Reply via email to