MINOR: mworker: deserialize process list before read_cfg_in_discovery_mode
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Fri, 11 Oct 2024 17:39:12 +0000 (19:39 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2024 20:02:39 +0000 (22:02 +0200)
commitee7fc983200a326113614064e3681a6c4bd4b456
treed1837ddf3c643094cb43f167b9932c3784b3beb0
parent7a267c4a276e3648b2e4bf107587b6f3e00de77d
MINOR: mworker: deserialize process list before read_cfg_in_discovery_mode

This patch is a part of series to reintroduce the program support in the new
master-worker architecture.

For the moment we keep the order of program and worker forks the same as before
the refactoring, as we need to be sure that this won't introduce regressions.
So, programs are forked before the new worker process.

Before the program's fork we already need deserialized processes list to find
the programs launched before reload and to stop them. Processes list saved
before the reload in HAPROXY_PROCESSES variable. It should be deserialized
before the first configuration read in discovery mode, because resetenv keyword
could be presented in the global section.

So, let's move mworker_env_to_proc_list() from mworker_create_master_cli() to
main(). We need to call it only after reload in master-worker mode, thus
HAPROXY_MWORKER_REEXEC and HAPROXY_PROCESSES should be still presented in the
re-executing process environment before the first configuration read.
src/haproxy.c
src/mworker.c