]> granicus.if.org Git - apache/commitdiff
event: Fix worker-listener deadlock in graceful restart caused by get_worker()
authorJan Kaluža <jkaluza@apache.org>
Mon, 6 Oct 2014 06:07:47 +0000 (06:07 +0000)
committerJan Kaluža <jkaluza@apache.org>
Mon, 6 Oct 2014 06:07:47 +0000 (06:07 +0000)
allocating new worker after ap_queue_info_term(), but not setting the
have_idle_worker variable. PR 56960.

Submitted By: Zin UDA
Committed By: jkaluza

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1629577 13f79535-47bb-0310-9956-ffa450edef68

server/mpm/event/event.c

index 115be59b4780fcbe55a8d814b7f4012fbc82d4e4..ccd9eb3c6604c9f20c56c7dfd3058c4879c23058 100644 (file)
@@ -1385,13 +1385,13 @@ static void get_worker(int *have_idle_worker_p, int blocking, int *all_busy)
     else
         rc = ap_queue_info_try_get_idler(worker_queue_info);
 
-    if (rc == APR_SUCCESS) {
+    if (rc == APR_SUCCESS || APR_STATUS_IS_EOF(rc)) {
         *have_idle_worker_p = 1;
     }
     else if (!blocking && rc == APR_EAGAIN) {
         *all_busy = 1;
     }
-    else if (!APR_STATUS_IS_EOF(rc)) {
+    else {
         ap_log_error(APLOG_MARK, APLOG_ERR, rc, ap_server_conf, APLOGNO(00472)
                      "ap_queue_info_wait_for_idler failed.  "
                      "Attempting to shutdown process gracefully");