Skip to content

Commit bf7a280

Browse files
author
Olivier Houchard
committed
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.
1 parent 9766211 commit bf7a280

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

src/thread.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,6 +1394,12 @@ int thread_map_to_groups()
13941394
for (g = 0; g < global.nbtgroups; g++) {
13951395
if (!ha_tgroup_info[g].count)
13961396
ug++;
1397+
else {
1398+
if (ha_tgroup_info[g].count > global.maxthrpertgroup) {
1399+
ha_alert("thread-group %d assigned too many threads (%d, max=%d)\n", g, ha_tgroup_info[g].count, global.maxthrpertgroup);
1400+
return -1;
1401+
}
1402+
}
13971403
ha_tgroup_info[g].tgid_bit = 1UL << g;
13981404
}
13991405

@@ -2135,11 +2141,6 @@ static int cfg_parse_thread_group(char **args, int section_type, struct proxy *c
21352141
return -1;
21362142
}
21372143

2138-
if (ha_tgroup_info[tgroup-1].count > global.maxthrpertgroup) {
2139-
memprintf(err, "'%s %ld' assigned too many threads (%d, max=%d)", args[0], tgroup, tot, global.maxthrpertgroup);
2140-
return -1;
2141-
}
2142-
21432144
return 0;
21442145
}
21452146

0 commit comments

Comments
 (0)