From e677824cfa104dd89f332318d4d22d52c588e933 Mon Sep 17 00:00:00 2001 From: Greg Ames Date: Fri, 18 Nov 2011 15:54:18 +0000 Subject: [PATCH] garbage C's in server-status and extra child processes with async lingering 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 | 4 +++- server/mpm/event/event.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/server/connection.c b/server/connection.c index 13ba951b0c..6e4495f838 100644 --- a/server/connection.c +++ b/server/connection.c @@ -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 */ diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index dcaf536a07..cb1266bb87 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -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); -- 2.40.0