]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Merge r1893014, r1893073 from trunk:
authorYann Ylavic <ylavic@apache.org>
Wed, 8 Sep 2021 08:25:29 +0000 (08:25 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 8 Sep 2021 08:25:29 +0000 (08:25 +0000)
mpm_event: Fix children processes possibly not stopped on graceful restart.

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.

Submitted by: Joel Self <joelself gmail.com>

mpm_event: Follow up to r1893014: log when children are not spawned.

Log at trace1 level when active_daemons >= active_daemons_limit and we won't
spawn children. Reset free_length to avoid negative value in this case too.

Submitted by: ylavic
Reviewed by: ylavic, covener, rpluem

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1893109 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
server/mpm/event/event.c

diff --git a/CHANGES b/CHANGES
index 0e5bb22ba643b164d2bd5625fec8fca4e5f93d7d..988df145ab1a3ec578bbc58671c653bebd5dde2a 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,6 +1,9 @@
                                                          -*- coding: utf-8 -*-
 Changes with Apache 2.4.49
 
+  *) mpm_event: Fix children processes possibly not stopped on graceful
+     restart.  PR 63169.  [Joel Self <joelself gmail.com>]
+
   *) mod_proxy: Fix a potential infinite loop when tunneling Upgrade(d)
      protocols from mod_proxy_http, and a timeout triggering falsely when
      using mod_proxy_wstunnel, mod_proxy_connect or mod_proxy_http with
index 5b293900ed395fbe27ab355b619aca42c2194ad2..8302091cd5c4cd2d03e6c4c67109b4d481248e03 100644 (file)
@@ -2929,6 +2929,20 @@ 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) {
+                if (active_daemons < active_daemons_limit) {
+                    free_length = active_daemons_limit - active_daemons;
+                }
+                else {
+                    ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf,
+                                 "server is at active daemons limit, spawning "
+                                 "of %d children cancelled: %d/%d active, "
+                                 "rate %d", free_length,
+                                 active_daemons, active_daemons_limit,
+                                 retained->idle_spawn_rate[child_bucket]);
+                    free_length = 0;
+                }
+            }
             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 "