From: Willy Tarreau Date: Mon, 4 Jul 2022 11:36:16 +0000 (+0200) Subject: BUG/MEDIUM: threads: fix incorrect thread group being used on soft-stop X-Git-Tag: v2.7-dev2~112 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=291f6ff885e4143b592a0cf8312d621bd8b3e1dd;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: threads: fix incorrect thread group being used on soft-stop Commit 377e37a80 ("MINOR: tinfo: add the mask of enabled threads in each group") forgot -1 on the tgid, thus the groups was not always correctly tested, which is visible only when running with more than one group. No backport is needed. --- diff --git a/src/haproxy.c b/src/haproxy.c index e2503c228c..145c19af98 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -2985,7 +2985,7 @@ static void *run_thread_poll_loop(void *data) ptff->fct(); #ifdef USE_THREAD - if (!_HA_ATOMIC_AND_FETCH(&ha_tgroup_info[ti->tgid].threads_enabled, ~ti->ltid_bit)) + if (!_HA_ATOMIC_AND_FETCH(&ha_tgroup_info[ti->tgid-1].threads_enabled, ~ti->ltid_bit)) _HA_ATOMIC_AND(&all_tgroups_mask, ~tg->tgid_bit); _HA_ATOMIC_AND(&all_threads_mask, ~tid_bit); if (tid > 0)