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

markt-asf pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new efac26d1f5 Fix possible path for UpgradeInfo not to be unregistered
efac26d1f5 is described below

commit efac26d1f50765bfc4929df315f85ffab7b54926
Author: Mark Thomas <[email protected]>
AuthorDate: Mon Nov 9 14:26:52 2026 +0000

    Fix possible path for UpgradeInfo not to be unregistered
    
    Fixes an intermittently failing test
---
 java/org/apache/coyote/AbstractProtocol.java | 7 +++++++
 webapps/docs/changelog.xml                   | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/java/org/apache/coyote/AbstractProtocol.java 
b/java/org/apache/coyote/AbstractProtocol.java
index abc0c5ebc7..2f450ae9a9 100644
--- a/java/org/apache/coyote/AbstractProtocol.java
+++ b/java/org/apache/coyote/AbstractProtocol.java
@@ -1438,6 +1438,13 @@ public abstract class AbstractProtocol<S> implements 
ProtocolHandler, MBeanRegis
 
                 if (processor != null) {
                     wrapper.setCurrentProcessor(processor);
+                    if (wrapper.isClosed()) {
+                        /*
+                         * The socket was closed while this thread owned the 
processor so the close could not release
+                         * it.
+                         */
+                        release(wrapper);
+                    }
                 }
                 return state;
             } catch (SocketException e) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 83279322fd..ca399a7baa 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -787,6 +787,10 @@
         connection to be closed as soon as the server started waiting for the
         client. (markt)
       </fix>
+      <fix>
+        Fix unregistering of UpgradeInfo when a connection is closed. Patch
+        suggested by abernal. (markt)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Jasper">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to