diff options
author | Yann Ylavic <ylavic@apache.org> | 2018-08-29 14:27:31 +0200 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2018-08-29 14:27:31 +0200 |
commit | 972ad6c66d7f67c847ada45c050e031a88774489 (patch) | |
tree | 0f4c1291eaaf3a3fb1b63f0511d67793ed25e174 /server/mpm/event | |
parent | mod_proxy: follow up to r1645529: 502 in case of SSL handshake failure. (diff) | |
download | apache2-972ad6c66d7f67c847ada45c050e031a88774489.tar.xz apache2-972ad6c66d7f67c847ada45c050e031a88774489.zip |
MPMs: early initialize scoreboard's child generation number.
Since [mpm]_note_child_killed uses the scoreboard's generation number for
child_status hook (MPM_CHILD_EXITED), we must initialize it early (i.e. in
[mpm]_note_child_started where MPM_CHILD_STARTED is set) to avoid race
conditions on restart (e.g. storm/loop of restarts) leading to AH00546.
PR 62658.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1839571 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm/event')
-rw-r--r-- | server/mpm/event/event.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 47053a7d7b..e491927103 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -748,10 +748,10 @@ static void event_note_child_killed(int childnum, pid_t pid, ap_generation_t gen static void event_note_child_started(int slot, pid_t pid) { + ap_generation_t gen = retained->mpm->my_generation; ap_scoreboard_image->parent[slot].pid = pid; - ap_run_child_status(ap_server_conf, - ap_scoreboard_image->parent[slot].pid, - retained->mpm->my_generation, slot, MPM_CHILD_STARTED); + ap_scoreboard_image->parent[slot].generation = gen; + ap_run_child_status(ap_server_conf, pid, gen, slot, MPM_CHILD_STARTED); } static const char *event_get_name(void) |