diff options
| author | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:28 +0100 |
|---|---|---|
| committer | Stefan Fritsch <sf@sfritsch.de> | 2011-12-27 19:42:28 +0100 |
| commit | 02a0e3b89d2ea1b984365e692c910668d75c6dcd (patch) | |
| tree | b9ba1c635c12bace3b2afbe7f548a0aab67102f5 /server/mpm | |
| parent | 0268977037115539ad65a26e858aa0df8d18cd13 (diff) | |
| download | apache2-02a0e3b89d2ea1b984365e692c910668d75c6dcd.tar.gz | |
Upstream tarball 2.2.11upstream/2.2.11
Diffstat (limited to 'server/mpm')
| -rw-r--r-- | server/mpm/experimental/event/event.c | 4 | ||||
| -rw-r--r-- | server/mpm/worker/fdqueue.c | 12 |
2 files changed, 12 insertions, 4 deletions
diff --git a/server/mpm/experimental/event/event.c b/server/mpm/experimental/event/event.c index 261468ea..bbee899e 100644 --- a/server/mpm/experimental/event/event.c +++ b/server/mpm/experimental/event/event.c @@ -650,7 +650,7 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock, ap_lingering_close(c); apr_pool_clear(p); ap_push_pool(worker_queue_info, p); - return 1; + return 0; } else if (cs->state == CONN_STATE_CHECK_REQUEST_LINE_READABLE) { apr_status_t rc; @@ -680,7 +680,7 @@ static int process_socket(apr_pool_t * p, apr_socket_t * sock, AP_DEBUG_ASSERT(rc == APR_SUCCESS); } } - return 0; + return 1; } /* requests_this_child has gone to zero or below. See if the admin coded diff --git a/server/mpm/worker/fdqueue.c b/server/mpm/worker/fdqueue.c index d46dd536..dfbe8c47 100644 --- a/server/mpm/worker/fdqueue.c +++ b/server/mpm/worker/fdqueue.c @@ -155,7 +155,15 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info, * region, one of two things may have happened: * - If the idle worker count is still zero, the * workers are all still busy, so it's safe to - * block on a condition variable. + * block on a condition variable, BUT + * we need to check for idle worker count again + * when we are signaled since it can happen that + * we are signaled by a worker thread that went idle + * but received a context switch before it could + * tell us. If it does signal us later once it is on + * CPU again there might be no idle worker left. + * See + * https://issues.apache.org/bugzilla/show_bug.cgi?id=45605#c4 * - If the idle worker count is nonzero, then a * worker has become idle since the first check * of queue_info->idlers above. It's possible @@ -166,7 +174,7 @@ apr_status_t ap_queue_info_wait_for_idler(fd_queue_info_t *queue_info, * now nonzero, it's safe for this function to * return immediately. */ - if (queue_info->idlers == 0) { + while (queue_info->idlers == 0) { rv = apr_thread_cond_wait(queue_info->wait_for_idler, queue_info->idlers_mutex); if (rv != APR_SUCCESS) { |
