tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Henri Gomez <>
Subject AJP13 problem on Tomcat 4.1.15
Date Wed, 20 Nov 2002 08:29:34 GMT
While playing with 4.1.15, I discovered some nasty problem with the 
AJP13 implementation from JTC.

1) TC 4.1.15 set socket timeout (20000 = 20s) which make give you
    Read exception after 20s of inactivity between webserver and Tomcat :

90577 [Thread-6] ERROR common.ChannelSocket  - Error, closing connection Read timed out
	at Method)
	at org.apache.jk.common.ChannelSocket.receive(
	at org.apache.jk.common.SocketConnection.runIt(

The problem is that the socket is NOT close at that time and even if TC
free the thread, the socket still exists and make webserver think that 
it could send request (and sus wait forever replies !!!!)

I'll commit a patch to make the socket close in a finally area.

2) The second problem is related to the socket timeout settings.
    In Ajp13 protocol, the webserver decide when it had to close
    the socket since it's the client (initiator) of the connection.
    if tomcat close the socket, the webserver won't detect before it will
    try to read replies. It's a known problem with Sockets implementation
    which make that write() calls on a half-closed connection DIDN'T
    return error CODE, only read() calls with report the error that the
    remote decided to close the connection.

As such I strongly recommand to disable the connectionTime by removing 
the connectionTimeout in server.xml :

     <!-- Define a Coyote/JK2 AJP 1.3 Connector on port 8009 -->
     <Connector className="org.apache.coyote.tomcat4.CoyoteConnector"
                port="8009" minProcessors="5" maxProcessors="75"
                enableLookups="true" redirectPort="8443"
                acceptCount="10" debug="0" connectionTimeout="0"

You should know that mod_jk 1.2.0 (don't know for latest 2.0.x),
have settings now which make webserver close unused sockets after
some time, just to be sure that the tomcat didn't have TOO many unused 

3) I saw that linger are set to 100, which is not recommanded in

To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message