]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Aha! This explains some of the weird things I was seeing.
authorJim Jagielski <jim@apache.org>
Mon, 6 Aug 2007 14:08:37 +0000 (14:08 +0000)
committerJim Jagielski <jim@apache.org>
Mon, 6 Aug 2007 14:08:37 +0000 (14:08 +0000)
Pull down and fold in patch from r109510 for event.c

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@563144 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/experimental/event/event.c

index 3dbf39a9373c6b5fa43fb0fb0ac925cfe124f424..f8b50321496f90a28c9222b9cb0efcfff1f6cdd1 100644 (file)
@@ -1650,6 +1650,21 @@ static int make_child(server_rec * s, int slot)
         clean_child_exit(0);
     }
     /* else */
+    if (ap_scoreboard_image->parent[slot].pid != 0) {
+        /* This new child process is squatting on the scoreboard
+         * entry owned by an exiting child process, which cannot
+         * exit until all active requests complete.
+         * Don't forget about this exiting child process, or we
+         * won't be able to kill it if it doesn't exit by the
+         * time the server is shut down.
+         */
+        ap_log_error(APLOG_MARK, APLOG_DEBUG, 0, ap_server_conf,
+                     "taking over scoreboard slot from %" APR_PID_T_FMT "%s",
+                     ap_scoreboard_image->parent[slot].pid,
+                     ap_scoreboard_image->parent[slot].quiescing ?
+                         " (quiescing)" : "");
+        ap_register_extra_mpm_process(ap_scoreboard_image->parent[slot].pid);
+    }
     ap_scoreboard_image->parent[slot].quiescing = 0;
     ap_scoreboard_image->parent[slot].pid = pid;
     return 0;
@@ -1907,6 +1922,9 @@ static void server_main_loop(int remaining_children_to_start)
                     make_child(ap_server_conf, child_slot);
                     --remaining_children_to_start;
                 }
+            }
+            else if (ap_unregister_extra_mpm_process(pid.pid) == 1) {
+                /* handled */
 #if APR_HAS_OTHER_CHILD
             }
             else if (apr_proc_other_child_alert(&pid, APR_OC_REASON_DEATH,