diff options
author | Aaron Bannert <aaron@apache.org> | 2002-04-29 00:13:32 +0200 |
---|---|---|
committer | Aaron Bannert <aaron@apache.org> | 2002-04-29 00:13:32 +0200 |
commit | 03966a632c41241dfd40a37896c32e8f15c70b9d (patch) | |
tree | 9a9bc26ae8453fa67f0526ae321febf034613c30 /server/mpm | |
parent | When we signal a condition variable, we need to own the lock that (diff) | |
download | apache2-03966a632c41241dfd40a37896c32e8f15c70b9d.tar.xz apache2-03966a632c41241dfd40a37896c32e8f15c70b9d.zip |
Detect APR_EINTR from ap_queue_pop() and avoid calling
ap_queue_info_set_idle() more than once at a time per worker thread.
This fixes an assert coredump.
Submitted by: Aaron Bannert
Reviewed by: Brian Pane
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@94840 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server/mpm')
-rw-r--r-- | server/mpm/worker/worker.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/server/mpm/worker/worker.c b/server/mpm/worker/worker.c index c6111616db..40b6bc9ff9 100644 --- a/server/mpm/worker/worker.c +++ b/server/mpm/worker/worker.c @@ -878,13 +878,17 @@ static void * APR_THREAD_FUNC worker_thread(apr_thread_t *thd, void * dummy) } ap_update_child_status_from_indexes(process_slot, thread_slot, SERVER_READY, NULL); +worker_pop: + if (workers_may_exit) { + break; + } rv = ap_queue_pop(worker_queue, &csd, &ptrans); if (rv != APR_SUCCESS) { /* We get APR_EOF during a graceful shutdown once all the connections * accepted by this server process have been handled. */ - if (rv == APR_EOF) { + if (APR_STATUS_IS_EOF(rv)) { break; } /* We get APR_EINTR whenever ap_queue_pop() has been interrupted @@ -898,7 +902,11 @@ static void * APR_THREAD_FUNC worker_thread(apr_thread_t *thd, void * dummy) * may have already been cleaned up. Don't log the "error" if * workers_may_exit is set. */ - if (rv != APR_EINTR && !workers_may_exit) { + else if (APR_STATUS_IS_EINTR(rv)) { + goto worker_pop; + } + /* We got some other error. */ + else if (!workers_may_exit) { ap_log_error(APLOG_MARK, APLOG_CRIT, rv, ap_server_conf, "ap_queue_pop failed"); } |