]> granicus.if.org Git - apache/commitdiff
Detect APR_EINTR from ap_queue_pop() and avoid calling
authorAaron Bannert <aaron@apache.org>
Sun, 28 Apr 2002 22:13:32 +0000 (22:13 +0000)
committerAaron Bannert <aaron@apache.org>
Sun, 28 Apr 2002 22:13:32 +0000 (22:13 +0000)
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

server/mpm/worker/worker.c

index c6111616db46592e44011c72284848e3ce98e37e..40b6bc9ff9d6b52ab4829cf28740fe034cbdf0f4 100644 (file)
@@ -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");
             }