]> granicus.if.org Git - apache/commitdiff
Terminate keep-alive connections when dying
authorStefan Fritsch <sf@apache.org>
Sun, 10 Apr 2016 20:35:18 +0000 (20:35 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 10 Apr 2016 20:35:18 +0000 (20:35 +0000)
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

server/mpm/event/event.c

index c36c869414a762e4f6d63ef1fe3d5c360fc30b1a..381e9d14f65fa7b6cf57ab3428d9f2f8a9af440a 100644 (file)
@@ -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);
             }