BUG/MINOR: threads: fix soft-stop without multithreading support
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 12 May 2025 09:57:39 +0000 (11:57 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 15 May 2025 15:01:43 +0000 (17:01 +0200)
commit66657f786a3662f8cb46d6d2adc9e621b1127e83
treeea6b9133b6417960b7f005dfed696c44578f46f5
parentadebe6246558ece09c82fbbf3e549cf5e4cdd2ec
BUG/MINOR: threads: fix soft-stop without multithreading support

When thread support is disabled ("USE_THREAD=" or "USE_THREAD=0" when
building), soft-stop doesn't work as haproxy never ends after stopping
the proxies.

This used to work fine in the past but suddenly stopped working with
ef422ced91 ("MEDIUM: thread: make stopping_threads per-group and add
stopping_tgroups") because the "break;" instruction under the stopping
condition is never executed when support for multithreading is disabled.

To fix the issue, let's add an "else" block to run the "break;"
instruction when USE_THREAD is not defined.

It should be backported up to 2.8

(cherry picked from commit 7d057e56af86cdc98c5388986931c247dbafa5b3)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/haproxy.c