remm 2003/02/08 08:55:20 Modified: coyote/src/java/org/apache/coyote/tomcat5 Constants.java CoyoteConnector.java Log: - I just found that lingering could be causing some problems with some clients, and cause a delay when closing a socket (causing too many processing threads to be allocated). I found the issue when testing TC with M$ stress tool, which caused TC to run out of threads, with all threads busy waiting to close their socket while the test was in progress. After the test, everything returned to normal, though. - The default is now not to set lingering to false (the default for a socket). - The setting is now configurable in the connector. Revision Changes Path 1.5 +1 -0 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/Constants.java Index: Constants.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/Constants.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- Constants.java 3 Dec 2002 02:29:14 -0000 1.4 +++ Constants.java 8 Feb 2003 16:55:20 -0000 1.5 @@ -70,6 +70,7 @@ public static final String Package = "org.apache.coyote.tomcat5"; + public static final int DEFAULT_CONNECTION_LINGER = -1; public static final int DEFAULT_CONNECTION_TIMEOUT = 60000; public static final int PROCESSOR_IDLE = 0; 1.13 +32 -1 jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteConnector.java Index: CoyoteConnector.java =================================================================== RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat5/CoyoteConnector.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -r1.12 -r1.13 --- CoyoteConnector.java 29 Jan 2003 16:39:11 -0000 1.12 +++ CoyoteConnector.java 8 Feb 2003 16:55:20 -0000 1.13 @@ -202,6 +202,13 @@ /** + * Linger value on the incoming connection. + * Note : a value inferior to 0 means no linger. + */ + private int connectionLinger = Constants.DEFAULT_CONNECTION_LINGER; + + + /** * Timeout value on the incoming connection. * Note : a value of 0 means no timeout. */ @@ -390,6 +397,28 @@ /** + * Return the connection linger for this Connector. + */ + public int getConnectionLinger() { + + return (connectionLinger); + + } + + + /** + * Set the connection linger for this Connector. + * + * @param count The new connection linge + */ + public void setConnectionLinger(int connectionLinger) { + + this.connectionLinger = connectionLinger; + + } + + + /** * Return the connection timeout for this Connector. */ public int getConnectionTimeout() { @@ -1053,6 +1082,8 @@ "" + acceptCount); IntrospectionUtils.setProperty(protocolHandler, "tcpNoDelay", "" + tcpNoDelay); + IntrospectionUtils.setProperty(protocolHandler, "soLinger", + "" + connectionLinger); IntrospectionUtils.setProperty(protocolHandler, "soTimeout", "" + connectionTimeout); IntrospectionUtils.setProperty(protocolHandler, "timeout",
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]