Hi, maybe completely off-topic, but we have the same kind of code in worker.c.
Just my 2c, CJ Le 07/09/2021 à 11:34, yla...@apache.org a écrit :
Author: ylavic Date: Tue Sep 7 09:34:09 2021 New Revision: 1893014 URL: http://svn.apache.org/viewvc?rev=1893014&view=rev Log: 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. Proposed by: Joel Self <joelself gmail.com> Added: httpd/httpd/trunk/changes-entries/event_maintenance_spawn_limit.txt Modified: httpd/httpd/trunk/server/mpm/event/event.c Added: httpd/httpd/trunk/changes-entries/event_maintenance_spawn_limit.txt URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/changes-entries/event_maintenance_spawn_limit.txt?rev=1893014&view=auto ============================================================================== --- httpd/httpd/trunk/changes-entries/event_maintenance_spawn_limit.txt (added) +++ httpd/httpd/trunk/changes-entries/event_maintenance_spawn_limit.txt Tue Sep 7 09:34:09 2021 @@ -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 Modified: httpd/httpd/trunk/server/mpm/event/event.c URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1893014&r1=1893013&r2=1893014&view=diff ============================================================================== --- httpd/httpd/trunk/server/mpm/event/event.c (original) +++ httpd/httpd/trunk/server/mpm/event/event.c Tue Sep 7 09:34:09 2021 @@ -3237,6 +3237,9 @@ static void perform_idle_server_maintena 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 "