]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: startup: split sending oldpids_sig logic for standalone and mworker modes
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Thu, 3 Oct 2024 09:16:35 +0000 (11:16 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commit81dbc2c2e27fbd312e956c873a7c3145edde1c87
tree496630c78b3cd3bb5526ce97dfc34ee1e2b2b5ba
parentb73a278df4eb0465c96587b69532934745225276
MEDIUM: startup: split sending oldpids_sig logic for standalone and mworker modes

Before refactoring the master-worker mode, in all runtime modes, when the new
process successfully parsed its configuration and bound to sockets, it sent
either SIGUSR1 or SIGTERM to the previous one in order to terminate it.

Let's keep this logic as is for the standalone mode. In addition, in standalone
mode we need to send the signal to old process before calling set_identity(),
because in set_identity() effective user or group may change. So, the order is
important here.

In case of master-worker mode after refactoring, master terminates the previous
worker by itself up to receiving "READY" status from the new one in
_send_status(). Master also sets at this moment HAPROXY_LOAD_SUCCESS env
variable and checks, if there are some other workers to terminate with
max_reloads exceeded.

So, now in master-worker mode we terminate old workers only, when the new one
has successfully done all initialization steps and has sent "READY" status to
master.
src/cli.c
src/haproxy.c