From: Aaron Bannert Date: Sun, 28 Apr 2002 22:13:32 +0000 (+0000) Subject: Detect APR_EINTR from ap_queue_pop() and avoid calling X-Git-Tag: 2.0.36~47 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=03966a632c41241dfd40a37896c32e8f15c70b9d;p=apache 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 --- 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"); }