]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: threads: fix incorrect thread group being used on soft-stop
authorWilly Tarreau <w@1wt.eu>
Mon, 4 Jul 2022 11:36:16 +0000 (13:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 4 Jul 2022 11:37:31 +0000 (13:37 +0200)
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.

src/haproxy.c

index e2503c228c96a6fe7661142ad81ba6657297a0c4..145c19af98c353a90f344614713d981dd803570b 100644 (file)
@@ -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)