From: Ryan Bloom Date: Tue, 3 Jul 2001 13:58:10 +0000 (+0000) Subject: Fix the forking/killing logic in the threaded MPM. The problem we were X-Git-Tag: 2.0.20~22 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=8be07b823297f26ca5b24552c91fb90bf1db5b5c;p=apache Fix the forking/killing logic in the threaded MPM. The problem we were seeing with the server eating itself wasn't because we were comparing the idle_thread_count and min/max spare servers wrong. It was because we were counting idle_thread_count incorrectly. This fixes that problem. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89495 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c index 2331df0ca9..f601c0d6cd 100644 --- a/server/mpm/threaded/threaded.c +++ b/server/mpm/threaded/threaded.c @@ -1003,15 +1003,15 @@ static void perform_idle_server_maintenance(void) } ap_max_daemons_limit = last_non_dead + 1; - if (idle_thread_count > max_spare_threads * total_non_dead) { - /* Kill off one child */ + if (idle_thread_count > max_spare_threads) { char char_of_death = '!'; + /* Kill off one child */ if ((rv = apr_file_write(pipe_of_death_out, &char_of_death, &one)) != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_WARNING, rv, ap_server_conf, "write pipe_of_death"); } idle_spawn_rate = 1; } - else if (idle_thread_count < min_spare_threads * total_non_dead) { + else if (idle_thread_count < min_spare_threads) { /* terminate the free list */ if (free_length == 0) { /* only report this condition once */