From: Justin Erenkrantz Date: Wed, 19 Sep 2001 05:58:09 +0000 (+0000) Subject: This patch fixes a nasty bug in the worker MPM where the X-Git-Tag: 2.0.26~222 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=11618332249fb3ec61327c37dca12dda2a4de671;p=thirdparty%2Fapache%2Fhttpd.git This patch fixes a nasty bug in the worker MPM where the state of the worker threads was not being reported back to the scoreboard, and eventually all the threads running in the children would be reported as being in the "C -- closing connection" state. This would wreak havoc on the idle_server_maintenance() routine. Since these threads would never be counted as idle, the server would spawn children as fast as possible. Submitted by: Aaron Bannert Reviewed by: Justin Erenkrantz git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@91079 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/CHANGES b/CHANGES index bd85b53c9a8..621f0f9f47c 100644 --- a/CHANGES +++ b/CHANGES @@ -1,5 +1,7 @@ Changes with Apache 2.0.26-dev + *) Fix worker MPM's scoreboard logic. [Aaron Bannert ] + *) Eliminate the wasteful run-time conversion of method names from strings to numbers in places where the methods are known at compile time. [Brian Pane ] diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 1647b9d4272..67745f7425b 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -697,7 +697,11 @@ static void *worker_thread(apr_thread_t *thd, void * dummy) free(ti); + (void) ap_update_child_status(process_slot, thread_slot, + SERVER_STARTING, (request_rec *)NULL); while (!workers_may_exit) { + (void) ap_update_child_status(process_slot, thread_slot, + SERVER_READY, (request_rec *)NULL); rv = ap_queue_pop(worker_queue, &csd, &ptrans); /* We get FD_QUEUE_EINTR whenever ap_queue_pop() has been interrupted * from an explicit call to ap_queue_interrupt_all(). This allows