From a1119d62f3f6865dd85d2404d768cca821e3322f Mon Sep 17 00:00:00 2001 From: markt Date: Fri, 21 Jan 2011 16:49:02 +0000 Subject: [PATCH] Fix possible thread exhaustion With a breakpoint in the servlet handling the timeout event, I was seeing a new thread being allocated from the poll every second or so git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1061900 13f79535-47bb-0310-9956-ffa450edef68 --- java/org/apache/tomcat/util/net/NioEndpoint.java | 2 ++ webapps/docs/changelog.xml | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index 5fc440fa9..8a5ed0801 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1387,6 +1387,8 @@ public class NioEndpoint extends AbstractEndpoint { long timeout = (ka.getTimeout()==-1)?((long) socketProperties.getSoTimeout()):(ka.getTimeout()); boolean isTimedout = delta > timeout; if (isTimedout) { + // Prevent subsequent timeouts if the timeout event takes a while to process + ka.access(Long.MAX_VALUE); processSocket(ka.getChannel(), SocketStatus.TIMEOUT, true); } }//end if diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 31f27e286..e3644dd29 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -90,6 +90,14 @@ + + + + Prevent possible thread exhaustion if a Comet timeout event takes a + while to complete. (markt) + + + -- 2.11.0