From: Olivier Houchard Date: Fri, 6 Feb 2026 01:59:14 +0000 (+0100) Subject: BUG/MEDIUM: threads: Differ checking the max threads per group number X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bf7a2808fc46d0bf26bf89b0383af887811555b6;p=thirdparty%2Fhaproxy.git BUG/MEDIUM: threads: Differ checking the max threads per group number Differ checking the max threads per group number until we're done parsing the configuration file, as it may be set after a "thread-group- directive. Otherwise the default value of 64 will be used, even if there is a max-threads-per-group directive. This should be backported to 3.3. --- diff --git a/src/thread.c b/src/thread.c index e10e32dbd..7e27ad009 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1394,6 +1394,12 @@ int thread_map_to_groups() for (g = 0; g < global.nbtgroups; g++) { if (!ha_tgroup_info[g].count) ug++; + else { + if (ha_tgroup_info[g].count > global.maxthrpertgroup) { + ha_alert("thread-group %d assigned too many threads (%d, max=%d)\n", g, ha_tgroup_info[g].count, global.maxthrpertgroup); + return -1; + } + } ha_tgroup_info[g].tgid_bit = 1UL << g; } @@ -2135,11 +2141,6 @@ static int cfg_parse_thread_group(char **args, int section_type, struct proxy *c return -1; } - if (ha_tgroup_info[tgroup-1].count > global.maxthrpertgroup) { - memprintf(err, "'%s %ld' assigned too many threads (%d, max=%d)", args[0], tgroup, tot, global.maxthrpertgroup); - return -1; - } - return 0; }