diff options
author | Yann Ylavic <ylavic@apache.org> | 2016-12-15 23:17:26 +0000 |
---|---|---|
committer | Yann Ylavic <ylavic@apache.org> | 2016-12-15 23:17:26 +0000 |
commit | f7ff940a29b45b54c595d958d1082b92ab21c33d (patch) | |
tree | 2f7872d46675acb0cabe0399dbf46acd22f15126 /server | |
parent | 540e19cfb668d33f1ff7cbea8ac4ba939c2559c5 (diff) | |
download | httpd-f7ff940a29b45b54c595d958d1082b92ab21c33d.tar.gz |
event: follow up to r1762718.
On graceful shutdown/restart, kill kept-alive connections before poll()ing
again, avoiding to wait for their "normal" timers (before being woken up)
when they remain the last handled connections.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1774538 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r-- | server/mpm/event/event.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/server/mpm/event/event.c b/server/mpm/event/event.c index 01dc6c5eb7..11bb876a52 100644 --- a/server/mpm/event/event.c +++ b/server/mpm/event/event.c @@ -1967,12 +1967,16 @@ static void * APR_THREAD_FUNC listener_thread(apr_thread_t * thd, void *dummy) rc = apr_pollset_poll(event_pollset, timeout_interval, &num, &out_pfd); if (rc != APR_SUCCESS) { if (APR_STATUS_IS_EINTR(rc)) { - /* Woken up, either update timeouts or shutdown, - * both logics are above. + /* Woken up, if we are exiting we must fall through to kill + * kept-alive connections, otherwise we only need to update + * timeouts (logic is above, so restart the loop). */ - continue; + if (!listener_may_exit) { + continue; + } + timeout_time = 0; } - if (!APR_STATUS_IS_TIMEUP(rc)) { + else if (!APR_STATUS_IS_TIMEUP(rc)) { ap_log_error(APLOG_MARK, APLOG_CRIT, rc, ap_server_conf, APLOGNO(03267) "apr_pollset_poll failed. Attempting to " |