]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: mworker: add support of master recovery mode
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Mon, 7 Oct 2024 09:37:33 +0000 (11:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commit5909d508bc8432a0995076524aa431d76ef7ed38
tree0f37b3830d1d9721754c72bd507f37f1182a9974
parentfe4708feaa6a112114421fa17154e458fdb154f7
MEDIUM: mworker: add support of master recovery mode

In this commit we add run_master_in_recovery_mode(), which groups all necessary
initialization steps, which master should perform to be able to enter in its
polling loop (run_master()), when it fails while parsing its new config.

As exit_on_failure() is now adapted for master recovery mode. Let's register
it as atexit handler, when master enters in this mode. And let's remove
atexit_flag variable for master, because we no longer use it.

We also slightly refactor here read_cfg_in_discovery_mode() in order to call
run_master_in_recovery_mode() for the case, described above. Warning messages
are mandatory before calling the run_master_in_recovery_mode() as this allows
to stop haproxy with error, if it was launched in zero-warning mode.

So, in recovery mode master does not launch any worker. It just performs its
necessary initialization routines and enters in its polling loop to continue
to monitor the existed worker process.
src/haproxy.c