]> git.ipfire.org Git - thirdparty/haproxy.git/commit
CLEANUP: mworker: clean mworker_reexec
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Wed, 23 Oct 2024 13:46:54 +0000 (15:46 +0200)
committerWilliam Lallemand <wlallemand@haproxy.com>
Thu, 24 Oct 2024 09:32:20 +0000 (11:32 +0200)
commita0d727e0698d8b5f201667ffcd857824285b90d7
tree10b7f361fe544cb2d9fb1adb5730325b4dce0f78
parent4db0f69527676cc979d2fcf6768e23d1d2e3db2d
CLEANUP: mworker: clean mworker_reexec

Before refactoring master-worker architecture, resources to setup master CLI
for the new worker process (shared sockpair, entry in proc_list) were created
in init() before parsing the configuration and binding listening sockets. So,
master during its re-exec has had to cleanup the new worker's ressources in
a case, when it fails at some initialization step before the fork.

Now fork happens very early and worker parses its configuration by itself. If
it fails during the initialization stage, all clean ups (deleting the fds of
the shared sockpair, proc_list cleanup) are performed in SIGCHLD handler up to
catching the SIGCHLD corresponded to this new worker. So, there is no longer
need to call mworker_cleanup_proc() in mworker_reexec().

As for mworker_cleanlisteners(), there is no longer need to call this function.
Master parses now only "global" and "program" sections, so it allocates only
MASTER proxy, which is stopped in mworker_reexec() by mworker_cli_proxy_stop().

Let's keep the definitions of mworker_cleanlisteners() and
mworker_cleanup_proc() in mworker.c for the moment. We may reuse parts of its
code later.
src/haproxy.c