]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mworker/cli: keep the connection of the FD that ask for a reload
authorWilliam Lallemand <wlallemand@haproxy.org>
Thu, 22 Sep 2022 15:26:23 +0000 (17:26 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Thu, 22 Sep 2022 16:16:19 +0000 (18:16 +0200)
commitec059c249e3ab8512bea14628e0032c36b89a80b
treee2f0e32ab2f122c027a375b46e806d9a1c47a210
parentd2605cf0e5bf9fcbfd7b0d672d457f8754f7da89
MEDIUM: mworker/cli: keep the connection of the FD that ask for a reload

When using the "reload" command over the master CLI, all connections to
the master CLI were cut, this was unfortunate because it could have been
used to implement a synchronous reload command.

This patch implements an architecture to keep the connection alive after
the reload.

The master CLI is now equipped with a listener which uses a socketpair,
the 2 FDs of this socketpair are stored in the mworker_proc of the
master, which the master keeps via the environment variable.

ipc_fd[1] is used as a listener for the master CLI. During the "reload"
command, the CLI will send the FD of the current session over ipc_fd[0],
then the reload is achieved, so the master won't handle the recv of the
FD. Once reloaded, ipc_fd[1] receives the FD of the session, so the
connection is preserved. Of course it is a new context, so everything
like the "prompt mode" are lost.

Only the FD which performs the reload is kept.
src/haproxy.c
src/mworker.c