PR 51714. [Stefan Fritsch, Jim Jagielski, Ruediger Pluem, Eric Covener,
<lowprio20 gmail.com>]
+ *) mpm_prefork, mpm_worker, mpm_event: If a child is created just before
+ graceful restart and then exits because of a missing lock file, don't
+ shutdown the whole server. PR 39311. [Shawn Michael
+ <smichael rightnow com>]
+
*) mpm_event: Check the return value from ap_run_create_connection.
PR: 41194. [Davi Arnaut]
if (pid.pid != -1) {
processed_status = ap_process_child_status(&pid, exitwhy, status);
+ child_slot = ap_find_child_by_pid(&pid);
if (processed_status == APEXIT_CHILDFATAL) {
- shutdown_pending = 1;
- child_fatal = 1;
- return;
+ /* fix race condition found in PR 39311
+ * A child created at the same time as a graceful happens
+ * can find the lock missing and create a fatal error.
+ * It is not fatal for the last generation to be in this state.
+ */
+ if (child_slot < 0
+ || ap_get_scoreboard_process(child_slot)->generation
+ == retained->my_generation) {
+ shutdown_pending = 1;
+ child_fatal = 1;
+ return;
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf,
+ "Ignoring fatal error in child of previous "
+ "generation (pid %ld).",
+ (long)pid.pid);
+ retained->sick_child_detected = 1;
+ }
}
else if (processed_status == APEXIT_CHILDSICK) {
/* tell perform_idle_server_maintenance to check into this
retained->sick_child_detected = 1;
}
/* non-fatal death... note that it's gone in the scoreboard. */
- child_slot = ap_find_child_by_pid(&pid);
if (child_slot >= 0) {
for (i = 0; i < threads_per_child; i++)
ap_update_child_status_from_indexes(child_slot, i,
*/
if (pid.pid != -1) {
processed_status = ap_process_child_status(&pid, exitwhy, status);
+ child_slot = ap_find_child_by_pid(&pid);
if (processed_status == APEXIT_CHILDFATAL) {
- mpm_state = AP_MPMQ_STOPPING;
- return DONE;
+ /* fix race condition found in PR 39311
+ * A child created at the same time as a graceful happens
+ * can find the lock missing and create a fatal error.
+ * It is not fatal for the last generation to be in this state.
+ */
+ if (child_slot < 0
+ || ap_get_scoreboard_process(child_slot)->generation
+ == retained->my_generation) {
+ mpm_state = AP_MPMQ_STOPPING;
+ return DONE;
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf,
+ "Ignoring fatal error in child of previous "
+ "generation (pid %ld).",
+ (long)pid.pid);
+ }
}
/* non-fatal death... note that it's gone in the scoreboard. */
- child_slot = ap_find_child_by_pid(&pid);
if (child_slot >= 0) {
(void) ap_update_child_status_from_indexes(child_slot, 0, SERVER_DEAD,
(request_rec *) NULL);
if (pid.pid != -1) {
processed_status = ap_process_child_status(&pid, exitwhy, status);
+ child_slot = ap_find_child_by_pid(&pid);
if (processed_status == APEXIT_CHILDFATAL) {
- shutdown_pending = 1;
- child_fatal = 1;
- return;
+ /* fix race condition found in PR 39311
+ * A child created at the same time as a graceful happens
+ * can find the lock missing and create a fatal error.
+ * It is not fatal for the last generation to be in this state.
+ */
+ if (child_slot < 0
+ || ap_get_scoreboard_process(child_slot)->generation
+ == retained->my_generation) {
+ shutdown_pending = 1;
+ child_fatal = 1;
+ return;
+ }
+ else {
+ ap_log_error(APLOG_MARK, APLOG_WARNING, 0, ap_server_conf,
+ "Ignoring fatal error in child of previous "
+ "generation (pid %ld).",
+ (long)pid.pid);
+ retained->sick_child_detected = 1;
+ }
}
else if (processed_status == APEXIT_CHILDSICK) {
/* tell perform_idle_server_maintenance to check into this
retained->sick_child_detected = 1;
}
/* non-fatal death... note that it's gone in the scoreboard. */
- child_slot = ap_find_child_by_pid(&pid);
if (child_slot >= 0) {
for (i = 0; i < threads_per_child; i++)
ap_update_child_status_from_indexes(child_slot, i, SERVER_DEAD,