From 13fb7170beeea4afbe461d22bb13ba664ce299df Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 13 Sep 2023 10:13:30 +0200 Subject: [PATCH] BUG/MEDIUM: master/cli: Pin the master CLI on the first thread of the group 1 There is no reason to start the master CLI on several threads and on several groups. And in fact, it must not be done otherwise the same FD is inserted several times in the fdtab, leading to a crash during startup because of a BUG_ON(). It happens when several groups are configured. To fix the bug the master CLI is now pinned on the first thread of the first group. This patch should fix the issue #2259 and must be backported to 2.8. --- src/cli.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/cli.c b/src/cli.c index ec2fc91fb8..0a78ed7807 100644 --- a/src/cli.c +++ b/src/cli.c @@ -3244,6 +3244,9 @@ int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc) bind_conf->nice = -64; /* we want to boost priority for local stats */ bind_conf->options |= BC_O_UNLIMITED | BC_O_NOSTOP; + /* Pin master CLI on the first thread of the first group only */ + thread_set_pin_grp1(&bind_conf->thread_set, 1); + list_for_each_entry(l, &bind_conf->listeners, by_bind) { HA_ATOMIC_INC(&unstoppable_jobs); /* it's a sockpair but we don't want to keep the fd in the master */ -- 2.39.5