From b3c397fadf8ab836e0a6c10eeddb449ed282ebc3 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Tue, 17 Jun 2008 20:59:55 +0000 Subject: [PATCH] worker/event MPMs: graceful-stop doesn't work if the listener thread is waiting for an available worker thread. PR 43081 Reported by: Paul Querna Debugged by: Takashi Sato [takashi lans-tv.com] git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@668826 13f79535-47bb-0310-9956-ffa450edef68 --- server/mpm/experimental/event/event.c | 5 ++++- server/mpm/worker/worker.c | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/server/mpm/experimental/event/event.c b/server/mpm/experimental/event/event.c index 369dcdfed3..33868509c4 100644 --- a/server/mpm/experimental/event/event.c +++ b/server/mpm/experimental/event/event.c @@ -276,6 +276,10 @@ static void wakeup_listener(void) */ return; } + + /* unblock the listener if it's waiting for a worker */ + ap_queue_info_term(worker_queue_info); + /* * we should just be able to "kill(ap_my_pid, LISTENER_SIGNAL)" on all * platforms and wake up the listener thread since it is the only thread @@ -314,7 +318,6 @@ static void signal_threads(int mode) if (mode == ST_UNGRACEFUL) { workers_may_exit = 1; ap_queue_interrupt_all(worker_queue); - ap_queue_info_term(worker_queue_info); close_worker_sockets(); /* forcefully kill all current connections */ } } diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index 02d0f143ac..ed032df763 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -250,6 +250,10 @@ static void wakeup_listener(void) */ return; } + + /* unblock the listener if it's waiting for a worker */ + ap_queue_info_term(worker_queue_info); + /* * we should just be able to "kill(ap_my_pid, LISTENER_SIGNAL)" on all * platforms and wake up the listener thread since it is the only thread @@ -288,7 +292,6 @@ static void signal_threads(int mode) if (mode == ST_UNGRACEFUL) { workers_may_exit = 1; ap_queue_interrupt_all(worker_queue); - ap_queue_info_term(worker_queue_info); close_worker_sockets(); /* forcefully kill all current connections */ } } -- 2.40.0