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; }