PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
[ start all new proposals below, under PATCHES PROPOSED. ]
- * Event MPM: Rework locking of the timeout_mutex, to never hold it while
- calling blocking operations on the worker queue.
- Trunk version of patch:
- http://svn.apache.org/viewvc?view=rev&revision=567852
- http://svn.apache.org/viewvc?view=rev&revision=574462
- 2.2.x version of patch:
- http://people.apache.org/~pquerna/event-mpm-deadlock.patch
- +1: pquerna, jim, rpluem
PATCHES PROPOSED TO BACKPORT FROM TRUNK:
cs = APR_RING_FIRST(&timeout_head);
timeout_time = time_now + TIMEOUT_FUDGE_FACTOR;
while (!APR_RING_EMPTY(&timeout_head, conn_state_t, timeout_list)
- && cs->expiration_time < timeout_time
- && get_worker(&have_idle_worker)) {
+ && cs->expiration_time < timeout_time) {
cs->state = CONN_STATE_LINGER;
APR_RING_REMOVE(cs, timeout_list);
+ apr_thread_mutex_unlock(timeout_mutex);
+
+ if (!get_worker(&have_idle_worker)) {
+ apr_thread_mutex_lock(timeout_mutex);
+ APR_RING_INSERT_HEAD(&timeout_head, cs,
+ conn_state_t, timeout_list);
+ break;
+ }
rc = push2worker(&cs->pfd, event_pollset);
*/
}
have_idle_worker = 0;
+ apr_thread_mutex_lock(timeout_mutex);
cs = APR_RING_FIRST(&timeout_head);
}
apr_thread_mutex_unlock(timeout_mutex);