]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: mworker: fix -D -W -sf/-st modes
authorValentine Krasnobaeva <vkrasnobaeva@haproxy.com>
Tue, 3 Dec 2024 20:13:47 +0000 (21:13 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Fri, 6 Dec 2024 11:00:22 +0000 (12:00 +0100)
commitee111d2004ca653387515f340c504d18b71191c3
tree6491ffae3ab47bab3b10c941a10a524cad4234f3
parent1fead6c0ca8f8ad2f354fb4dfab241ec5281737c
BUG/MINOR: mworker: fix -D -W -sf/-st modes

When a new master process is launched like below:

./haproxy -W -D -p ha.pid -sf $(cat ha.pid)...

The old master process and its workers do not stop. Since the master-worker
refactoring, the code, which sends USR1/TERM to old pids from -sf, is called
only for the standalone mode. In master-worker mode we should receive the READY
message from the newly forked worker at first, in order to be able to terminate
the previous master.

So, to fix this, let's terminate the previous master in _send_status(), where
we parse the READY message from the newly forked worker. And let's continue to
use oldpids array, as it was in 3.0, in order to stop the workers, launched
before the reload.

This patch should be backported only in 3.1.
src/cli.c