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 9825246  Fix test failures caused by APR crash during shutdown
9825246 is described below

commit 9825246d0ce833552a3745ac3b02a44551789caa
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 19 19:56:23 2019 +0100

    Fix test failures caused by APR crash during shutdown
    
    When a request thread was still trying to read/write from/to the socket,
    the socket wrapper was not marked as closed so the thread tried to use
    an APR socket that the POller then closed. Trying to read/write from a
    closed APR socket will nearly always trigger a crash.
---
 java/org/apache/tomcat/util/net/AprEndpoint.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AprEndpoint.java 
b/java/org/apache/tomcat/util/net/AprEndpoint.java
index 46c7047..6dde69c 100644
--- a/java/org/apache/tomcat/util/net/AprEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AprEndpoint.java
@@ -1126,8 +1126,11 @@ public class AprEndpoint extends 
AbstractEndpoint<Long,Long> implements SNICallB
             // Close all sockets in the add queue
             info = addList.get();
             while (info != null) {
-                // Make sure the  socket isn't in the poller before we close it
+                // Make sure the socket isn't in the poller before we close it
                 removeFromPoller(info.socket);
+                // Close the SocketWrapper to prevent any still running 
application
+                // threads from trying to use the socket
+                connections.get(Long.valueOf(info.socket)).close();
                 // Poller isn't running at this point so use destroySocket()
                 // directly
                 destroySocket(info.socket);


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

Reply via email to