]> granicus.if.org Git - php/commitdiff
FPM: Prevent warning with raising pm.max_children for shared pool
authorJakub Zelenka <bukka@php.net>
Tue, 4 Aug 2020 20:01:13 +0000 (21:01 +0100)
committerJakub Zelenka <bukka@php.net>
Tue, 4 Aug 2020 20:01:13 +0000 (21:01 +0100)
sapi/fpm/fpm/fpm_conf.c
sapi/fpm/fpm/fpm_process_ctl.c
sapi/fpm/tests/status-listen.phpt

index c38f16d1abd398083682fc5befa66c6178e8543a..42f75a475df5f0cea4c8612b4539677cf49cd25c 100644 (file)
@@ -725,8 +725,6 @@ static int fpm_worker_pool_shared_status_alloc(struct fpm_worker_pool_s *shared_
 
        config->pm = PM_STYLE_ONDEMAND;
        config->pm_max_children = 2;
-       /* set to 1 to not warn about max children for shared pool */
-       shared_wp->warn_max_children = 1;
 
        current_wp->shared = shared_wp;
 
index b8122e2ad32fd8ce10fe9928abc30b5499c0f5ce..a2f0f935e443cf8ae078c5d1b5f239da5249ed4b 100644 (file)
@@ -390,7 +390,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
 
                if (idle < wp->config->pm_min_spare_servers) {
                        if (wp->running_children >= wp->config->pm_max_children) {
-                               if (!wp->warn_max_children) {
+                               if (!wp->warn_max_children && !wp->shared) {
                                        fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
                                        zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
                                        wp->warn_max_children = 1;
@@ -409,7 +409,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
                        /* get sure it won't exceed max_children */
                        children_to_fork = MIN(children_to_fork, wp->config->pm_max_children - wp->running_children);
                        if (children_to_fork <= 0) {
-                               if (!wp->warn_max_children) {
+                               if (!wp->warn_max_children && !wp->shared) {
                                        fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
                                        zlog(ZLOG_WARNING, "[pool %s] server reached pm.max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
                                        wp->warn_max_children = 1;
@@ -417,9 +417,7 @@ static void fpm_pctl_perform_idle_server_maintenance(struct timeval *now) /* {{{
                                wp->idle_spawn_rate = 1;
                                continue;
                        }
-                       if (!wp->shared) {
-                               wp->warn_max_children = 0;
-                       }
+                       wp->warn_max_children = 0;
 
                        fpm_children_make(wp, 1, children_to_fork, 1);
 
@@ -515,7 +513,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) /
 /*     zlog(ZLOG_DEBUG, "[pool %s] heartbeat running_children=%d", wp->config->name, wp->running_children);*/
 
        if (wp->running_children >= wp->config->pm_max_children) {
-               if (!wp->warn_max_children) {
+               if (!wp->warn_max_children && !wp->shared) {
                        fpm_scoreboard_update(0, 0, 0, 0, 0, 1, 0, FPM_SCOREBOARD_ACTION_INC, wp->scoreboard);
                        zlog(ZLOG_WARNING, "[pool %s] server reached max_children setting (%d), consider raising it", wp->config->name, wp->config->pm_max_children);
                        wp->warn_max_children = 1;
@@ -530,9 +528,7 @@ void fpm_pctl_on_socket_accept(struct fpm_event_s *ev, short which, void *arg) /
                        return;
                }
        }
-       if (!wp->shared) {
-               wp->warn_max_children = 0;
-       }
+       wp->warn_max_children = 0;
        fpm_children_make(wp, 1, 1, 1);
 
        if (fpm_globals.is_child) {
index 3b3fc652a1d2a76be84e9a5eaa99e0bf22adfa91..c6476c033205294b177cc0ae8fa43c7fc8ce5d5a 100644 (file)
@@ -2,8 +2,6 @@
 FPM: Status listen test
 --SKIPIF--
 <?php include "skipif.inc"; ?>
---XFAIL--
-Flaky test
 --FILE--
 <?php