]> granicus.if.org Git - apache/commitdiff
get the start thread to exit when we have reached termination but
authorJeff Trawick <trawick@apache.org>
Wed, 20 Mar 2002 03:38:07 +0000 (03:38 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 20 Mar 2002 03:38:07 +0000 (03:38 +0000)
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

server/mpm/worker/worker.c

index 14ff6f5de189a285d67c95404f164e8b8f72dc28..586999c2e374cb7ad2643444f5741ad884811d59 100644 (file)
@@ -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,