]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: mworker: mworker_kill should apply on every children
authorWilliam Lallemand <wlallemand@haproxy.com>
Tue, 16 Apr 2019 15:42:42 +0000 (17:42 +0200)
committerWilly Tarreau <w@1wt.eu>
Tue, 16 Apr 2019 16:14:29 +0000 (18:14 +0200)
Commit 3f12887 ("MINOR: mworker: don't use children variable anymore")
introduced a regression.

The previous behavior was to send a signal to every children, whether or
not they are former children. Instead of this, we only send a signal to
the current children, so we don't try to kill -INT or -TERM all
processes during a reload.

No backport needed.

src/mworker.c

index 6b94c4ff4c00ebb9fdce43537d8b008c7f339f7b..b7bb859aa0c019dd07a46f97ff8d254891c8ea17 100644 (file)
@@ -54,7 +54,7 @@ static void mworker_kill(int sig)
 
        list_for_each_entry(child, &proc_list, list) {
                /* careful there, we must be sure that the pid > 0, we don't want to emit a kill -1 */
-               if ((child->options & (PROC_O_TYPE_WORKER|PROC_O_TYPE_PROG)) && (child->reloads == 0) && (child->pid > 0))
+               if ((child->options & (PROC_O_TYPE_WORKER|PROC_O_TYPE_PROG)) && (child->pid > 0))
                        kill(child->pid, sig);
        }
 }