From: William Lallemand Date: Tue, 14 Nov 2023 12:58:53 +0000 (+0100) Subject: BUG/MEDIUM: mworker: set the master variable earlier X-Git-Tag: v2.9-dev10~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d76fa37534b75a746ea799ed79a6377d449f22f6;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: mworker: set the master variable earlier 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. --- diff --git a/src/haproxy.c b/src/haproxy.c index b37677ff6d..6c3ffdfb11 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -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);