You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Antonio Fiol Bonnín <fi...@terra.es> on 2004/02/20 17:21:17 UTC

Proposal: New parameter for JK2 connector

Hello,

Seen that mod_jk has a "socket_keepalive" option for the Apache side, my 
proposal consists in adding a similar setting in the Tomcat side.

Advantages:
If you pull the power cord of your Apache server (or something else bad 
happens to it), Tomcat will notice shortly after, and will close the 
associated connections, thus freeing threads, which are limited by 
maxThreads.

I know it is an unlikely situation, but I still think it is a good idea.

Suggestions welcome!


Yours,


Antonio Fiol



Re: Proposal: New parameter for JK2 connector

Posted by Antonio Fiol Bonnín <fi...@terra.es>.
Hi Bill,

>>Seen that mod_jk has a "socket_keepalive" option for the Apache side, my
>>proposal consists in adding a similar setting in the Tomcat side.
>>
>>Advantages:
>>If you pull the power cord of your Apache server (or something else bad
>>happens to it), Tomcat will notice shortly after, and will close the
>>associated connections, thus freeing threads, which are limited by
>>maxThreads.
>>
>>I know it is an unlikely situation, but I still think it is a good idea.
>>
>>Suggestions welcome!
>>    
>>
>It shouldn't be necessary, since the Tomcat side spends most of it's time
>attempting a 'read' on the Socket.  It should throw an IOException as soon
>as Apache drops its end of the Socket (via tripping over the power cord or
>otherwise :).
>  
>

How would that be possible?

Precisely because Tomcat is idle on a read() call on the socket, several 
things may happen:

1- A packet with data is received.
2- An ACK packet is received (or a keepalive by any means).
3- A FIN or RST or (what was it) packet is received.
4- Nothing is received.

And the OS will:
1- End the read() call by returning the received data to Tomcat.
2- The OS responds to the keepalive or ACK or anything, and Tomcat keeps 
idle on read().
3- The read() call will be aborted, and an exception will be risen.
4- Nothing happens (Tomcat keeps idle on read())

If you pull the porwer cord (or network cable, for this matters), (4) 
will happen. I mean: a dead machine does not (can not) send packets. So 
NOTHING will happen. Tomcat will not notice.

As I tried to show from the beginning...

Please consider that I am not looking into the case where Apache 
*process* dies, in which case (3) will happen, as you said. I really 
mean a *hardware* problem.

Yours,


Antonio Fiol


P.S.: If it is voted for, I may develop the necessary patch, as it is a 
fairly trivial one.



Re: Proposal: New parameter for JK2 connector

Posted by Bill Barker <wb...@wilshire.com>.
"Antonio Fiol Bonn�n" <fi...@terra.es> wrote in message
news:403633FD.7020009@terra.es...
> Hello,
>
> Seen that mod_jk has a "socket_keepalive" option for the Apache side, my
> proposal consists in adding a similar setting in the Tomcat side.
>
> Advantages:
> If you pull the power cord of your Apache server (or something else bad
> happens to it), Tomcat will notice shortly after, and will close the
> associated connections, thus freeing threads, which are limited by
> maxThreads.
>
> I know it is an unlikely situation, but I still think it is a good idea.
>
> Suggestions welcome!
>

It shouldn't be necessary, since the Tomcat side spends most of it's time
attempting a 'read' on the Socket.  It should throw an IOException as soon
as Apache drops its end of the Socket (via tripping over the power cord or
otherwise :).

>
> Yours,
>
>
> Antonio Fiol
>
>
>




---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org