]>
Commit | Line | Data |
---|---|---|
7f617c6f AM |
1 | --- httpd-2.2.24/server/mpm/prefork/prefork.c~ 2012-07-27 21:51:57.000000000 +0200 |
2 | +++ httpd-2.2.24/server/mpm/prefork/prefork.c 2013-04-09 17:58:05.772765411 +0200 | |
3 | @@ -1043,14 +1043,31 @@ | |
4 | * extra child | |
5 | */ | |
6 | if (pid.pid != -1) { | |
7 | + process_score *child_record; | |
8 | processed_status = ap_process_child_status(&pid, exitwhy, status); | |
9 | + child_slot = find_child_by_pid(&pid); | |
10 | if (processed_status == APEXIT_CHILDFATAL) { | |
11 | - mpm_state = AP_MPMQ_STOPPING; | |
12 | - return 1; | |
13 | + /* fix race condition found in PR 39311 | |
14 | + * A child created at the same time as a graceful happens | |
15 | + * can find the lock missing and create a fatal error. | |
16 | + * It is not fatal for the last generation to be in this state. | |
17 | + */ | |
18 | + child_record = ap_get_scoreboard_process(child_slot); | |
19 | + if (child_slot < 0 | |
20 | + || child_record->generation | |
21 | + == ap_my_generation) { | |
22 | + mpm_state = AP_MPMQ_STOPPING; | |
23 | + return DONE; | |
24 | + } | |
25 | + else { | |
26 | + ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf, | |
27 | + "Ignoring fatal error in child of previous " | |
28 | + "generation (pid %ld).", | |
29 | + (long)pid.pid); | |
30 | + } | |
31 | } | |
32 | ||
33 | /* non-fatal death... note that it's gone in the scoreboard. */ | |
34 | - child_slot = find_child_by_pid(&pid); | |
35 | if (child_slot >= 0) { | |
36 | (void) ap_update_child_status_from_indexes(child_slot, 0, SERVER_DEAD, | |
37 | (request_rec *) NULL); |