Bug 43696 - race condition when trying to shutdown httpd immediately after starting it
Summary: race condition when trying to shutdown httpd immediately after starting it
Status: RESOLVED FIXED
Alias: None
Product: Apache httpd-2
Classification: Unclassified
Component: mpm_prefork (show other bugs)
Version: 2.2.3
Hardware: All other
: P2 normal (vote)
Target Milestone: ---
Assignee: Apache HTTPD Bugs Mailing List
URL:
Keywords: FixedInTrunk, PatchAvailable
Depends on:
Blocks:
 
Reported: 2007-10-24 15:52 UTC by Arun Bhalla
Modified: 2012-02-26 16:46 UTC (History)
0 users



Attachments
patch to prefork.c (810 bytes, patch)
2007-10-24 15:53 UTC, Arun Bhalla
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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