Commit d7557930 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

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
parent ede5cbdc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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 */