]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: Fix children processes possibly not stopped on graceful restart.
authorYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 09:34:09 +0000 (09:34 +0000)
committerYann Ylavic <ylavic@apache.org>
Tue, 7 Sep 2021 09:34:09 +0000 (09:34 +0000)
The number of children spawned can go above active_daemons_limit due to
exponential idle_spawn_rate growth (x 2), enforce the upper limit in
perform_idle_server_maintenance().  PR 63169.

Proposed by: Joel Self <joelself gmail.com>

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

changes-entries/event_maintenance_spawn_limit.txt [new file with mode: 0644]
server/mpm/event/event.c

diff --git a/changes-entries/event_maintenance_spawn_limit.txt b/changes-entries/event_maintenance_spawn_limit.txt
new file mode 100644 (file)
index 0000000..7179c3b
--- /dev/null
@@ -0,0 +1,2 @@
+  *) mpm_event: Fix children processes possibly not stopped on graceful
+     restart.  PR 63169.  [Joel Self <joelself gmail.com>]
\ No newline at end of file
index 7bfd6750c895d300049c0f944cdc9dbdf7300b6f..bffa235a6f9ca195321fcf78a15df0afb2f777fa 100644 (file)
@@ -3237,6 +3237,9 @@ static void perform_idle_server_maintenance(int child_bucket, int num_buckets)
             if (free_length > retained->idle_spawn_rate[child_bucket]) {
                 free_length = retained->idle_spawn_rate[child_bucket];
             }
+            if (free_length + active_daemons > active_daemons_limit) {
+                free_length = active_daemons_limit - active_daemons;
+            }
             if (retained->idle_spawn_rate[child_bucket] >= 8) {
                 ap_log_error(APLOG_MARK, APLOG_INFO, 0, ap_server_conf, APLOGNO(00486)
                              "server seems busy, (you may need "