From: Olivier Houchard Date: Fri, 6 Feb 2026 01:49:26 +0000 (+0100) Subject: BUG/MINOR: threads: Initialize maxthrpertgroup earlier. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9766211cf05738a9245a5f4a76bc14343463facc;p=thirdparty%2Fhaproxy.git BUG/MINOR: threads: Initialize maxthrpertgroup earlier. Give global.maxthrpertgroup its default value at global creation, instead of later when we're trying to detect the thread count. It is used when verifying the configuration file validity, and if it was not set in the config file, in a few corner cases, the value of 0 would be used, which would then reject perfectly fine configuration files. This should be backported to 3.3. --- diff --git a/src/haproxy.c b/src/haproxy.c index 1ad4c58f8..99341730a 100644 --- a/src/haproxy.c +++ b/src/haproxy.c @@ -205,6 +205,7 @@ struct global global = { #endif /* by default allow clients which use a privileged port for TCP only */ .clt_privileged_ports = HA_PROTO_TCP, + .maxthrpertgroup = MAX_THREADS_PER_GROUP, /* others NULL OK */ }; diff --git a/src/thread.c b/src/thread.c index c156d84e5..e10e32dbd 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1641,9 +1641,6 @@ void thread_detect_count(void) if (global.nbtgroups) grp_min = grp_max = global.nbtgroups; - if (!global.maxthrpertgroup) - global.maxthrpertgroup = MAX_THREADS_PER_GROUP; - #if defined(USE_THREAD) /* Adjust to boot settings if not forced */ if (thr_min <= thread_cpus_enabled_at_boot && thread_cpus_enabled_at_boot < thr_max)