]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MEDIUM: threads/config: drop absent threads from thread groups
authorWilly Tarreau <w@1wt.eu>
Fri, 17 Oct 2025 18:36:00 +0000 (20:36 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 17 Oct 2025 18:36:00 +0000 (20:36 +0200)
commitc365e47095495ddf33ee7ae4f010f3cf5ef71bfc
treebbea0bd78817c74d6ba0c2d5508e4679d6620e46
parent8b7a82cd3009a270a551837c9070efdb018b8823
BUG/MEDIUM: threads/config: drop absent threads from thread groups

Thread groups can be assigned arbitrary thread ranges, but if the
mentioned threads do not exist, this causes crashes in listener_accept()
or some connections to be ignored. The reason is that the calculated
mask is derived from the thread group's enabled threads count. Examples:

  global
     nbthread 2
     thread-groups 2
     thread-group 1 1-64
     thread-group 2 65-128

  frontend f-crash
     bind :8001 thread 1/all

  frontend f-freeze
     bind :8002 thread 2/all

This commit removes missing threads, emits a warning when the thread
group just has less threads than requested, and an error when it is
left with no threads at all.

This must be backported to 3.1 since the issue is present there already.
src/thread.c