]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mpm_event: Follow up to r1899777: Fix max_daemon_used.
authorYann Ylavic <ylavic@apache.org>
Wed, 13 Apr 2022 13:51:04 +0000 (13:51 +0000)
committerYann Ylavic <ylavic@apache.org>
Wed, 13 Apr 2022 13:51:04 +0000 (13:51 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1899812 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c

index b064d8023543b8f0b27c6ee863ab427dfa50ff1e..595fac0b0f10934b9aed8caa367a321f7e9c8344 100644 (file)
@@ -3215,16 +3215,8 @@ static void perform_idle_server_maintenance(int child_bucket,
             free_slots[free_length++] = i;
         }
     }
-
     if (*max_daemon_used < last_non_dead + 1) {
         *max_daemon_used = last_non_dead + 1;
-
-        /* Below make_child() can grow retained->max_daemon_used, so
-         * be accurate if the one being computed is higher already.
-         */
-        if (retained->max_daemon_used < *max_daemon_used) {
-            retained->max_daemon_used = *max_daemon_used;
-        }
     }
 
     if (retained->sick_child_detected) {
@@ -3357,7 +3349,13 @@ static void perform_idle_server_maintenance(int child_bucket,
                              retained->total_daemons);
             }
             for (i = 0; i < free_length; ++i) {
-                make_child(ap_server_conf, free_slots[i], child_bucket);
+                int slot = free_slots[i];
+                if (make_child(ap_server_conf, slot, child_bucket) < 0) {
+                    continue;
+                }
+                if (*max_daemon_used < slot + 1) {
+                    *max_daemon_used = slot + 1;
+                }
             }
             /* the next time around we want to spawn twice as many if this
              * wasn't good enough, but not if we've just done a graceful