Bug 43696

Summary: race condition when trying to shutdown httpd immediately after starting it
Product: Apache httpd-2 Reporter: Arun Bhalla <arun>
Component: mpm_preforkAssignee: Apache HTTPD Bugs Mailing List <bugs>
Status: RESOLVED FIXED    
Severity: normal Keywords: FixedInTrunk, PatchAvailable
Priority: P2    
Version: 2.2.3   
Target Milestone: ---   
Hardware: All   
OS: other   
Attachments: patch to prefork.c

Description Arun Bhalla 2007-10-24 15:52:12 UTC
This was first noticed while using httpd 2.2.3 on Solaris SPARC, but the bug is
still present in httpd 2.2.6 and could surface on any platform using prefork.

The issue is that the signal handlers are installed before the restart_pending
and shutdown_pending variables are initialized.  If httpd receives SIGTERM while
child processes are being spawned, it will be completely ignored.  The following
two commands, one immediately called after the other, can reproduce the situation:

  httpd -k start
  httpd -k stop
Comment 1 Arun Bhalla 2007-10-24 15:53:09 UTC
Created attachment 21040 [details]
patch to prefork.c
Comment 2 Stefan Fritsch 2011-07-26 20:38:48 UTC
fixed in trunk in r1151233
Comment 3 Stefan Fritsch 2012-02-26 16:46:49 UTC
fixed in 2.4.1