Fix possible thread exhaustion
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Jan 2011 16:49:02 +0000 (16:49 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 21 Jan 2011 16:49:02 +0000 (16:49 +0000)
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
webapps/docs/changelog.xml

index 5fc440f..8a5ed08 100644 (file)
@@ -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
index 31f27e2..e3644dd 100644 (file)
       </fix>
     </changelog>
   </subsection>
+  <subsection>
+    <changelog>
+      <fix>
+        Prevent possible thread exhaustion if a Comet timeout event takes a
+        while to complete. (markt)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Jasper">
     <changelog>
       <fix>