]> granicus.if.org Git - apache/commitdiff
worker/event MPMs: graceful-stop doesn't work if the listener thread is
authorGreg Ames <gregames@apache.org>
Tue, 17 Jun 2008 20:59:55 +0000 (20:59 +0000)
committerGreg Ames <gregames@apache.org>
Tue, 17 Jun 2008 20:59:55 +0000 (20:59 +0000)
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
server/mpm/worker/worker.c

index 369dcdfed3dddf9205cbe0b641b8b79067efb805..33868509c4f3970da52147dbea79d619ec6baeda 100644 (file)
@@ -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 */
     }
 }
index 02d0f143ac9b237c6fe099e2286a898244322223..ed032df7631a4affbad5f91094bfb7a02d4a23d7 100644 (file)
@@ -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 */
     }
 }