]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: mworker: set the master variable earlier
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 14 Nov 2023 12:58:53 +0000 (13:58 +0100)
committerWilliam Lallemand <wlallemand@haproxy.com>
Tue, 14 Nov 2023 13:32:39 +0000 (14:32 +0100)
Since 2.7 and the mcli_reload_bind_conf (56f73b21a5c), upon a reload
failure because of a bind error, the mcli_reload_bind_conf go through a
sock_unbind((). This is not supposed to do anything when a listener is
RX_F_INHERITED in the master, but unfortunately this is done too early
and provokes an exit of the master.

We already suspected in the past that setting the 'master' variable this
late could have negative impact.

The fix sets the master variable earlier before the bind.

This must be backported at least to 2.7. This could be backported
earlier but better wait any feedbacks on the fix.

src/haproxy.c

index b37677ff6d1dca71d2c994eb7a0d9c4a275732fa..6c3ffdfb11a7ec080d28eaffd4564104836bb003 100644 (file)
@@ -2200,6 +2200,7 @@ static void init(int argc, char **argv)
        if (global.mode & (MODE_MWORKER|MODE_MWORKER_WAIT)) {
                struct wordlist *it, *c;
 
+               master = 1;
                /* get the info of the children in the env */
                if (mworker_env_to_proc_list() < 0) {
                        exit(EXIT_FAILURE);