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