Welcome! Log In Create A New Profile

Advanced

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Maxim Dounin
October 12, 2020 04:16PM
Hello!

On Thu, Oct 08, 2020 at 03:31:57AM -0400, tored wrote:

> Thanks Maxim to taking the time to respond.
>
> > This feature wasn't removed in 5e6142609e48, but rather it was
> > changed how things work: instead of doing a full scan over all
> > connections on each event loop iteration, nginx now does it only
> > once, and also makes sure no new idle connections are added after
> > the shutdown signal.
> >
>
> I don't fully understand what happens to non-idle keep-alive connections
> after the shutdown signal is sent.
>
> If I understand correctly, non-idle keep-alive connections will continue to
> serve requests after a graceful shutdown, until they are terminated by
> "normal" events, such as:
> * connection is closed/terminated by the client
> * or by the server, e.g if (r->connection->requests >=
> clcf->keepalive_requests)
> * or if keepalive_timeout is meet
> * any other event that would close the connection during normal operation

No. Connections won't be allowed to go into the keepalive state
after a graceful shutdown was initiated, see the following check
in the ngx_http_finalize_connection() function:

if (!ngx_terminate
&& !ngx_exiting
&& r->keepalive
&& clcf->keepalive_timeout > 0)
{
ngx_http_set_keepalive(r);
return;
}

That is, additional requests will be only processed on a
connection if keepalive is enabled and nginx worker is not
shutting down. If nginx worker is shutting down, the connection
will be closed.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

Keepalived Connections Reset after reloading the configuration (HUP Signal)

Jocelyn Mocquant May 13, 2011 07:24PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Maxim Dounin May 16, 2011 07:34AM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Jocelyn Mocquant May 16, 2011 06:14PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

darthhexx March 28, 2019 08:49PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

zakirenish September 11, 2020 05:54PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

tored October 07, 2020 04:29AM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Maxim Dounin April 01, 2019 01:06PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Maxim Dounin October 07, 2020 09:56AM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

tored October 08, 2020 03:31AM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

Maxim Dounin October 12, 2020 04:16PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

allenhe February 17, 2021 11:40PM

Re: Keepalived Connections Reset after reloading the configuration (HUP Signal)

allenhe February 18, 2021 03:14AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 282
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready