]> granicus.if.org Git - apache/commitdiff
garbage C's in server-status and extra child processes with async lingering
authorGreg Ames <gregames@apache.org>
Fri, 18 Nov 2011 15:54:18 +0000 (15:54 +0000)
committerGreg Ames <gregames@apache.org>
Fri, 18 Nov 2011 15:54:18 +0000 (15:54 +0000)
close support in Event.  these are set by the listener due to a residual
c->sbh for a worker thread no longer associated with the connection.

the associated worker threads are really idle and blocked in
ap_queue_pop_something and will serve new work normally.  but since they
are marked as SERVER_CLOSING rather than SERVER_READY in the scoreboard,
the parent process thinks they are busy and forks extra children.

reproduction recipe: start Event with server-status enabled.  hit
localhost/server-status?refresh=5 and watch the C's trail behind the lone W.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1203708 13f79535-47bb-0310-9956-ffa450edef68

server/connection.c
server/mpm/event/event.c

index 13ba951b0c2410570a84adda38d84cde7bc8d0b1..6e4495f838969efee0ab11b594091d945fe6cba4 100644 (file)
@@ -102,7 +102,9 @@ AP_DECLARE(int) ap_start_lingering_close(conn_rec *c)
         return 1;
     }
 
-    ap_update_child_status(c->sbh, SERVER_CLOSING, NULL);
+    if (c->sbh) {
+        ap_update_child_status(c->sbh, SERVER_CLOSING, NULL);
+    }
 
 #ifdef NO_LINGCLOSE
     ap_flush_conn(c); /* just close it */
index dcaf536a07be25512d4379a38eaf5fa1bc875dae..cb1266bb87e65cfe505d20e5916c4fe8f985f49e 100644 (file)
@@ -793,6 +793,11 @@ static void process_pollop(pollset_op_t *op)
 static int start_lingering_close(conn_state_t *cs, ap_equeue_t *eq)
 {
     apr_status_t rv;
+
+    cs->c->sbh = NULL;  /* prevent scoreboard updates from the listener 
+                         * worker will loop around soon and set SERVER_READY
+                         */
+
     if (ap_start_lingering_close(cs->c)) {
         apr_pool_clear(cs->p);
         ap_push_pool(worker_queue_info, cs->p);