You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by ji...@apache.org on 2007/09/13 14:20:07 UTC
svn commit: r575282 - in /httpd/httpd/branches/2.2.x: STATUS
server/mpm/experimental/event/event.c
Author: jim
Date: Thu Sep 13 05:20:04 2007
New Revision: 575282
URL: http://svn.apache.org/viewvc?rev=575282&view=rev
Log:
* 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
Modified:
httpd/httpd/branches/2.2.x/STATUS
httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c
Modified: httpd/httpd/branches/2.2.x/STATUS
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/STATUS?rev=575282&r1=575281&r2=575282&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/STATUS (original)
+++ httpd/httpd/branches/2.2.x/STATUS Thu Sep 13 05:20:04 2007
@@ -79,14 +79,6 @@
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:
Modified: httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c
URL: http://svn.apache.org/viewvc/httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c?rev=575282&r1=575281&r2=575282&view=diff
==============================================================================
--- httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c (original)
+++ httpd/httpd/branches/2.2.x/server/mpm/experimental/event/event.c Thu Sep 13 05:20:04 2007
@@ -1020,12 +1020,19 @@
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);
@@ -1038,6 +1045,7 @@
*/
}
have_idle_worker = 0;
+ apr_thread_mutex_lock(timeout_mutex);
cs = APR_RING_FIRST(&timeout_head);
}
apr_thread_mutex_unlock(timeout_mutex);