You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Joe Orton <jo...@redhat.com> on 2005/01/26 12:43:10 UTC

Re: Behavior of long-running CGI scripts?

OK, a month late, but...

On Sat, Dec 18, 2004 at 11:40:03PM -0800, Justin Erenkrantz wrote:
> What is *supposed* to be the behavior of long-running CGI scripts that have 
> their connections closed on them before they complete?  Are they supposed 
> to finish, or abort prematurely?  Do they receive some signal when the 
> parent closes its handle?

You're seeing expected behaviour, I think.

httpd only finds out that the TCP connection was closed as and when it
tries to write to it.  So if the CGI script doesn't write anything for >
Timeout seconds, the server never finds out that the connection was
aborted, and the normal timeout handling applies. i.e. the script is
ignored until r->pool is destroyed, when the pipes are closed then the
script is SIGTERMed (or SIGKILLed if it hangs around ignoring SIGTERM)

is that any use?

joe