httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jim Jagielski <...@jaguNET.com>
Subject Re: Apache 1.3.x race condition causes gratuitous 3-second CGI delay
Date Fri, 16 Feb 2001 20:04:21 GMT
>Hello,
>
>We've discovered an apparent race condition in Apache 1.3.x CGI handling
>which results in occasional unnecessary 3-second delays resulting from a
>pause between the closing of the CGI child process' pipe and that process'
>subsequent exit.
>
>Specifically, the code in mod_cgi.c reads from its child process until the
>child process breaks the pipe. The cleanup code in alloc.c then calls
>waitpid with WNOHANG to check to see if its child process has died; if its
>pid is not waiting, Apache assumes that the process has hung. It sends a
>SIGTERM, waits 3 seconds, then sends a SIGKILL. The relevant code is in
>free_proc_chain() in alloc.c.
>

Thanks for the very detailed write-up. We'll look deeper and see if
we can clean this up, and use existing knowledge to TERM-wait-KILL
only when needed.
-- 
===========================================================================
   Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
          "Casanova will have many weapons; To beat him you will
              have to have more than forks and flatulence."

Mime
View raw message