httpd-bugs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject [Bug 56960] New: worker and listener thread dead-lock in graceful shutdown
Date Thu, 11 Sep 2014 12:01:16 GMT

            Bug ID: 56960
           Summary: worker and listener thread dead-lock in graceful
           Product: Apache httpd-2
           Version: 2.4.10
          Hardware: PC
                OS: Solaris
            Status: NEW
          Severity: normal
          Priority: P2
         Component: mpm_event

In case of worker process graceful shutdown, listener thread cannot get worker
for processing connections under asynchronous state because get_worker() will
not set *have_idle_worker_p. This raise the dead-lock problem, that is the
listener thread cannot get idle workers to process asynchronous (e.g.
CONN_STATE_WRITE_COMPLETION) because the get_worker don't pass
have_idle_worker, but workers are already waiting in ap_queue_pop_something().

This is because the ap_queue_info_wait_for_idler() will return APR_EOF with
allocating idle worker (s.t. decreasing worker_queue_info->idlers) after
ap_queue_info_term() but the get_worker() will not set *have_idle_worker_p in
APR_EOF case. So the listener_thread() multiply call get_worker() for
processing waiting connections and worker_queue_info->idlers goes to pt_zero.

diff -r -u httpd-2.4.10.orig//server/mpm/event/event.c
--- httpd-2.4.10.orig//server/mpm/event/event.c Thu Jun 26 07:01:31 2014
+++ httpd-2.4.10//server/mpm/event/event.c      Thu Sep 11 19:04:52 2014
@@ -1271,13 +1271,13 @@
         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");

You are receiving this mail because:
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message