com php-src: FPM: Prevent warning with raising pm.max_child ren for shared pool: sapi/fpm/fpm/fpm_conf.c sa pi/fpm/fpm/fpm_process_ctl.c
sapi/fpm/tests/status-list en.phpt
| From: | Jakub Zelenka | Date: | Tue, 04 Aug 2020 20:01:13 +0000 |
| Subject: | com php-src: FPM: Prevent warning with raising pm.max_child ren for shared pool: sapi/fpm/fpm/fpm_conf.c sa pi/fpm/fpm/fpm_process_ctl.c sapi/fpm/tests/status-list en.phpt |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-112553@lists.php.net to get a copy of this message | ||
Commit: 37a878b8c3fdd47ef5883a7a44a262c1c9909b0a
Author: Jakub Zelenka <bukka@php.net> Tue, 4 Aug 2020 21:01:13 +0100
Parents: a359635cb1a4df8b5137a506c88c4cb102acac0e
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=37a878b8c3fdd47ef5883a7a44a262c1c9909b0a
Log:
FPM: Prevent warning with raising pm.max_children for shared pool
Changed paths:
M sapi/fpm/fpm/fpm_conf.c
M sapi/fpm/fpm/fpm_process_ctl.c
M sapi/fpm/tests/status-listen.phpt
Diff:
diff --git a/sapi/fpm/fpm/fpm_conf.c b/sapi/fpm/fpm/fpm_conf.c
index c38f16d1ab..42f75a475d 100644
--- a/sapi/fpm/fpm/fpm_conf.c
+++ b/sapi/fpm/fpm/fpm_conf.c
@@ -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;
diff --git a/sapi/fpm/fpm/fpm_process_ctl.c b/sapi/fpm/fpm/fpm_process_ctl.c
index b8122e2ad3..a2f0f935e4 100644
--- a/sapi/fpm/fpm/fpm_process_ctl.c
+++ b/sapi/fpm/fpm/fpm_process_ctl.c
@@ -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) {
diff --git a/sapi/fpm/tests/status-listen.phpt b/sapi/fpm/tests/status-listen.phpt
index 3b3fc652a1..c6476c0332 100644
--- a/sapi/fpm/tests/status-listen.phpt
+++ b/sapi/fpm/tests/status-listen.phpt
@@ -2,8 +2,6 @@
FPM: Status listen test
--SKIPIF--
<?php include "skipif.inc"; ?>
---XFAIL--
-Flaky test
--FILE--
<?php