From: Stefan Fritsch Date: Sun, 10 Apr 2016 20:35:18 +0000 (+0000) Subject: Terminate keep-alive connections when dying X-Git-Tag: 2.5.0-alpha~1764 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=598acf1743bc89cbb56fd5b7cdd1b4e01fb60f5e;p=apache Terminate keep-alive connections when dying When shutting down a process gracefully, terminate keep-alive connections so that we don't get any new requests which may keep the dying process alive longer. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1738464 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index c36c869414..381e9d14f6 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -2075,11 +2075,12 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) /* If all workers are busy, we kill older keep-alive connections so that they * may connect to another process. */ - if (workers_were_busy && *keepalive_q->total) { - ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf, - "All workers are busy, will close %d keep-alive " - "connections", - *keepalive_q->total); + if ((workers_were_busy || dying) && *keepalive_q->total) { + if (!dying) + ap_log_error(APLOG_MARK, APLOG_TRACE1, 0, ap_server_conf, + "All workers are busy, will close %d keep-alive " + "connections", + *keepalive_q->total); process_timeout_queue(keepalive_q, 0, start_lingering_close_nonblocking); }