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

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

commit 50d4b6fd940928ca8a11420297503f563503b501
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Apr 19 17:45:56 2024 +0100

    SocketTimeout has no impact for acceptor unlock - remove it
---
 java/org/apache/tomcat/util/net/AbstractEndpoint.java | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/AbstractEndpoint.java 
b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
index f4f31085a4..1e0f3bf28b 100644
--- a/java/org/apache/tomcat/util/net/AbstractEndpoint.java
+++ b/java/org/apache/tomcat/util/net/AbstractEndpoint.java
@@ -1285,15 +1285,12 @@ public abstract class AbstractEndpoint<S,U> {
             unlockAddress = getUnlockAddress(localAddress);
 
             try (java.net.Socket s = new java.net.Socket()) {
-                int stmo = 2 * 1000;
                 int utmo = 2 * 1000;
-                if (getSocketProperties().getSoTimeout() > stmo) {
-                    stmo = getSocketProperties().getSoTimeout();
-                }
                 if (getSocketProperties().getUnlockTimeout() > utmo) {
                     utmo = getSocketProperties().getUnlockTimeout();
                 }
-                s.setSoTimeout(stmo);
+                // Never going to read from this socket so the timeout doesn't 
matter. Use the unlock timeout.
+                s.setSoTimeout(utmo);
                 // 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 
enabling linger but with a timeout of
                 // zero seconds seems to fix the issue.


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

Reply via email to