BUG/MEDIUM: mworker: set the master variable earlier

Since 2.7 and the mcli_reload_bind_conf (56f73b21a5), 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.
This commit is contained in:
William Lallemand 2023-11-14 13:58:53 +01:00
parent a63e016d27
commit d76fa37534

View 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);