httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrew Ho <>
Subject Re: Apache 1.3.x race condition causes gratuitous 3-second CGI delay
Date Sat, 17 Feb 2001 09:51:02 GMT

AH>We've discovered an apparent race condition in Apache 1.3.x CGI handling
AH>which results in occasional unnecessary 3-second delays resulting from a
AH>pause between the closing of the CGI child process' pipe and that process'
AH>subsequent exit.

JJ>Thanks for the very detailed write-up. We'll look deeper and see if
JJ>we can clean this up, and use existing knowledge to TERM-wait-KILL
JJ>only when needed.

Thanks for the response! FWIW, here is a patch to alloc.c which fixed the
problem for our installation; all it does is install a SIGCHLD handler
right before the sleep(3), and now that the signal is being paid attention
to, the signal pops us out of the sleep(). We then re-install any previous
SIGCHLD handler.

There's still a race between setting the handler and sleep()ing, but
that's a pretty tight race and the cost of it is a relatively non-tragic
3-second delay in subsequent Keep-Alive requests; not too bad.

What I'm afraid of is that our "fix" is entirely too naive. There's plenty
of interactions I'm not familiar with; for example, there may be multiple
SIGCHLDs flying around, and we don't check to see that the one that just
came is the right one.



Andrew Ho     
Engineer                   Voice 650-930-9062
Tellme Networks, Inc.       1-800-555-TELL            Fax 650-930-9101

View raw message