From: Jeff Trawick Date: Wed, 20 Mar 2002 03:38:07 +0000 (+0000) Subject: get the start thread to exit when we have reached termination but X-Git-Tag: 2.0.34~233 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=f8827903aa785ebc7f8d92b0225c3cabea031115;p=apache get the start thread to exit when we have reached termination but it is still trying to create worker threads previously, after a non-graceful restart followed by a terminate you could see a bunch of log messages showing the parent repeatedly sending SIGTERM and finally SIGKILL to one or more children... with this change, the sequence of messages should stop very soon add a comment to start_threads() describing a current problem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94030 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 14ff6f5de1..586999c2e3 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -792,6 +792,15 @@ static int check_signal(int signum) return 0; } +/* XXX unfortunate issue: + * with apachectl restart (not graceful), previous generation dies + * abruptly with no chance to clean up scoreboard entries; when new + * generation is started, processes can loop forever in start_threads() + * waiting for scoreboard entries for threads of prior generation to + * get cleaned up... but it will never happen and the new generation + * child looping here, waiting for scoreboard to get cleaned up, is + * wasted + */ static void * APR_THREAD_FUNC start_threads(apr_thread_t *thd, void *dummy) { thread_starter *ts = dummy; @@ -914,6 +923,9 @@ static void join_start_thread(apr_thread_t *start_thread_id) { apr_status_t rv, thread_rv; + workers_may_exit = 1; /* start thread may not want to exit until this + * is set + */ rv = apr_thread_join(&thread_rv, start_thread_id); if (rv != APR_SUCCESS) { ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf,