httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Covener <cove...@gmail.com>
Subject Re: svn commit: r1738464 - /httpd/httpd/trunk/server/mpm/event/event.c
Date Thu, 15 Dec 2016 19:06:55 GMT
I have been looking at this area a little bit from the perspective of
killing the keepalive conns as early as possible during graceful
process exit.

This might have had a bad interaction with the event wakeup patch
here.  Now we can sit in poll() for significant time after graceful
shutdown is signaled (immediately after the poll call that will be
EINTR'ed).  This will happen before the keepalive conns are moved to
lingering close.

I am not completely sure how 2.4.23 and 2.4.24 will differ here in
practice but that is also a concern.  I think something nearly as
simple as copying the 2nd block with

                process_keepalive_queue(0); /* kill'em all \m/ */

Into the block where poll returned EINTR may be close to what we need.
Another unexplored option might be to refer to short poll intervals
during shutdown, from the perspective of how these two features are
disturbing eachother.



On Sun, Apr 10, 2016 at 4:35 PM,  <sf@apache.org> wrote:
> Author: sf
> Date: Sun Apr 10 20:35:18 2016
> New Revision: 1738464
>
> URL: http://svn.apache.org/viewvc?rev=1738464&view=rev
> Log:
> 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.
>
>
> Modified:
>     httpd/httpd/trunk/server/mpm/event/event.c
>
> Modified: httpd/httpd/trunk/server/mpm/event/event.c
> URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/mpm/event/event.c?rev=1738464&r1=1738463&r2=1738464&view=diff
> ==============================================================================
> --- httpd/httpd/trunk/server/mpm/event/event.c (original)
> +++ httpd/httpd/trunk/server/mpm/event/event.c Sun Apr 10 20:35:18 2016
> @@ -2075,11 +2075,12 @@ static void * APR_THREAD_FUNC listener_t
>              /* 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);
>              }
>
>



-- 
Eric Covener
covener@gmail.com

Mime
View raw message