https://issues.apache.org/bugzilla/show_bug.cgi?id=56960
Bug ID: 56960
Summary: worker and listener thread dead-lock in graceful
shutdown
Product: Apache httpd-2
Version: 2.4.10
Hardware: PC
OS: Solaris
Status: NEW
Severity: normal
Priority: P2
Component: mpm_event
Assignee: [email protected]
Reporter: [email protected]
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//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 @@
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");
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]