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

markt 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 93741d0  Fix one potential cause of JVM crash on shutdown with 
APR/native
93741d0 is described below

commit 93741d0f5151aa818eab7d882bf80e877764ce36
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Aug 14 00:05:04 2019 +0100

    Fix one potential cause of JVM crash on shutdown with APR/native
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 6 ++++++
 webapps/docs/changelog.xml                       | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index f9bed26..2075783 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -517,6 +517,12 @@ public class AprEndpoint extends 
AbstractEndpoint<Long,Long> implements SNICallB
                     serverSock = 0;
                 }
             }
+            // Close any sockets not in the poller performing blocking
+            // read/writes. Need to do this before destroying the poller since
+            // that will also destroy the root pool for these sockets.
+            for (Long s : connections.keySet()) {
+                Socket.shutdown(s.longValue(), Socket.APR_SHUTDOWN_READWRITE);
+            }
             try {
                 poller.destroy();
             } catch (Exception e) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index cc87749..0cbf970 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -161,6 +161,10 @@
         of abusive client behaviour and close the connection if any such
         behaviour is detected. (markt)
       </add>
+      <fix>
+        Fix a crash on shutdown with the APR/native connector when a blocking
+        I/O operation was still in progress when the connector stopped. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Cluster">


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

Reply via email to