This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit b76216af5d8ad0608c3da5f0a9a273f3b46f647e Author: Mark Thomas <ma...@apache.org> AuthorDate: Fri Apr 19 18:08:09 2024 +0100 Reduce the default wait time for the acceptor unlock --- java/org/apache/tomcat/util/net/NioEndpoint.java | 7 ++++++- webapps/docs/changelog.xml | 6 ++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index c53164e256..9f646e73eb 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -296,7 +296,12 @@ public class NioEndpoint extends AbstractJsseEndpoint<NioChannel,SocketChannel> } if (running) { running = false; - acceptor.stopMillis(10000); + /* + * Need to wait for the acceptor to unlock but not too long. 100ms plus twice the unlock timeout should be + * plenty of time for the acceptor to unlock without being an excessively long wait if the unlock fails. + */ + int acceptorWaitMilliSeconds = 100 + 2 * getSocketProperties().getUnlockTimeout(); + acceptor.stopMillis(acceptorWaitMilliSeconds); if (poller != null) { poller.destroy(); poller = null; diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 53ebb4a103..c2a903f944 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -158,6 +158,12 @@ negative or zero value is configured, the default of <code>250ms</code> will be used. (mark) </fix> + <fix> + Reduce the time spent waiting for the connector to unlock. The previous + default of 10s was noticeably too long for cases where the unlock has + failed. The wait time is now 100ms plus twice + <code>socket.unlockTimeout</code>. (markt) + </fix> </changelog> </subsection> <subsection name="Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org