Welcome! Log In Create A New Profile

Advanced

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

March 28, 2019 08:49PM
Hi,

We are seeing some fallout from this behaviour on keep-alive connections when proxying traffic from remote POPs back to an Origin DC that, due to latency, brings about a race condition in the socket shutdown sequence. The result being the fateful "upstream prematurely closed connection while reading response header from upstream" in the Remote POP.

A walk through of what we are seeing:

1. Config reload happens on the Origin DC.
2. Socket shutdowns are sent to all open, but not transacting, keep-alive connections.
3. Remote POP sends data on a cached connection at around the same time as #2, because at this point it has not received the disconnect yet.
4. Remote POP then receives the disconnect and errors with "upstream prematurely..".

Ideally we should be able to have the Origin honour the `worker_shutdown_timeout` (or some other setting) for keep-alive connections. That way we would be able to use the `keepalive_timeout` setting for upstreams to ensure the upstream's cached connections always time out before a worker is shutdown. Would that be possible or is there another way to mitigate this scenario?

/David
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: 310
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