You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/02/13 15:10:17 UTC

[tomcat] branch 9.0.x updated: Work-around unexplained linger behaviour on MacOS

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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new ad83bb0961 Work-around unexplained linger behaviour on MacOS
ad83bb0961 is described below

commit ad83bb09610e3245da141bd29589ffe5777e5dd8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Feb 13 15:09:14 2023 +0000

    Work-around unexplained linger behaviour on MacOS
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index 96c632571b..63066e71a7 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -1089,7 +1089,10 @@ public abstract class AbstractEndpoint<S,U> {
                     utmo = getSocketProperties().getUnlockTimeout();
                 }
                 s.setSoTimeout(stmo);
-                s.setSoLinger(getSocketProperties().getSoLingerOn(),getSocketProperties().getSoLingerTime());
+                // Newer MacOS versions (e.g. Ventura 13.2) appear to linger for ~1s on close when linger is disabled.
+                // That causes delays when running the unit tests. Explicitly enableing linger but with a timeout of
+                // zero seconds seems to fix the issue.
+                s.setSoLinger(true, 0);
                 if (getLog().isDebugEnabled()) {
                     getLog().debug("About to unlock socket for:" + unlockAddress);
                 }


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