Hi,

Tomcat 5.5.x

A customer of mine is using the masterslave strategy and refuses to use anything else. We found a potential for a thread to leak from the 'ms' strategy if a null socket was returned from acceptSocket. The fix is very simple and posted below.

cheers,
-- dave

Index: util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java
===================================================================
--- util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java (revision 755706) +++ util/java/org/apache/tomcat/util/net/PoolTcpEndpoint.java (working copy)
@@ -646,7 +646,13 @@

// Accept the next incoming connection from the server socket
             Socket socket = acceptSocket();
-
+            if(socket == null)
+            {
+               // if the socket is null acceptSocket logs a warning.
+               // We don't need to log it again
+               recycleWorkerThread(workerThread);
+               continue;
+            }
             // Hand this socket off to an appropriate processor
             workerThread.assign(socket);


David Knox
Information System Architect
+1 303-748-8906
http://pragmaticis.blogspot.com





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

Reply via email to