From: Greg Ames Date: Tue, 7 Aug 2001 22:28:51 +0000 (+0000) Subject: clean up the scoreboard properly after threaded processes die gracefully. X-Git-Tag: 2.0.23~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a2f4e885954a7a57f403a0378cbe5ca37f523a38;p=apache clean up the scoreboard properly after threaded processes die gracefully. find_child_by_pid() failed to do its job, because ap_max_daemons_used was too low. There was some recent breakage in threaded that contributes to the problem. However, find_child_by_pid() should not be using the current number of daemons. It could have been recently reduced, which makes it fail to find the exiting process. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@90015 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/threaded/threaded.c b/server/mpm/threaded/threaded.c index 68d7c63bbb..f0b8992673 100644 --- a/server/mpm/threaded/threaded.c +++ b/server/mpm/threaded/threaded.c @@ -1047,9 +1047,11 @@ static void perform_idle_server_maintenance(void) } ++free_length; } + if (!all_dead_threads) { + last_non_dead = i; + } /* XXX if (!ps->quiescing) is probably more reliable GLA */ if (!any_dying_threads) { - last_non_dead = i; ++total_non_dead; } } diff --git a/server/scoreboard.c b/server/scoreboard.c index a7b0399346..22d9d91081 100644 --- a/server/scoreboard.c +++ b/server/scoreboard.c @@ -266,7 +266,7 @@ AP_DECLARE(int) find_child_by_pid(apr_proc_t *pid) int i; int max_daemons_limit; - ap_mpm_query(AP_MPMQ_MAX_DAEMON_USED, &max_daemons_limit); + ap_mpm_query(AP_MPMQ_MAX_DAEMONS, &max_daemons_limit); for (i = 0; i < max_daemons_limit; ++i) if (ap_scoreboard_image->parent[i].pid == pid->pid)