]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: threads: ignore max-threads-per-group when thread-groups is set
authorWilly Tarreau <w@1wt.eu>
Thu, 28 May 2026 14:48:51 +0000 (16:48 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 28 May 2026 16:49:47 +0000 (18:49 +0200)
As documented, max-threads-per-group is the default number of threads
to arrange in a group before creating another group, and is only meant
to be used when thread-groups is not set.

However it was always enforced, so configs like:

   global
       thready-groups 2

which were sufficient in 3.2 and above to start with 64-128 threads
are now suddenly limited to 32 threads! Let's relax the limit when
thread-groups is set!

No backport is needed since this is only 3.4.

src/thread.c

index a3e362d521bf7fa03ccb15ccb7d8c93e922c95fd..bb733a6029eb9c82737f4b7c27422b922112ab5e 100644 (file)
@@ -1679,8 +1679,11 @@ void thread_detect_count(void)
        if (global.nbthread)
                thr_min = thr_max = global.nbthread;
 
-       if (global.nbtgroups)
+       if (global.nbtgroups) {
                grp_min = grp_max = global.nbtgroups;
+               /* ignore max-threads-per-group if thread-groups is configured */
+               global.maxthrpertgroup = MAX_THREADS_PER_GROUP;
+       }
 
 #if defined(USE_THREAD)
        /* Adjust to boot settings if not forced */