From 5c9e7032da8e70d2f30ac804f40c9ddb20249143 Mon Sep 17 00:00:00 2001 From: Aurelien DARRAGON Date: Mon, 12 May 2025 11:57:39 +0200 Subject: [PATCH] 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 (cherry picked from commit 66657f786a3662f8cb46d6d2adc9e621b1127e83) Signed-off-by: Christopher Faulet --- src/haproxy.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/haproxy.c b/src/haproxy.c index 0ef9e68..142a1f8 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -3172,6 +3172,8 @@ void run_poll_loop() wake_thread(i); break; } +#else + break; #endif } } -- 1.7.10.4