]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: listener: rework thread assignment to consider all groups
authorWilly Tarreau <w@1wt.eu>
Mon, 27 Mar 2023 08:38:51 +0000 (10:38 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 21 Apr 2023 15:41:26 +0000 (17:41 +0200)
commit9d360604bd58e5ed02d27e3b7ec54d39d4779db6
treeb58a07b1b7fea7556e7170baa55441e0f5ca4342
parente6f5ab5afa1e11d509aa92588b64de6e3d3765a8
MEDIUM: listener: rework thread assignment to consider all groups

Till now threads were assigned in listener_accept() to other threads of
the same group only, using a single group mask. Now that we have all the
relevant info (array of listeners of the same shard), we can spread the
thr_idx to cover all assigned groups. The thread indexes now contain the
group number in their upper bits, and the indexes run over te whole list
of threads, all groups included.

One particular subtlety here is that switching to a thread from another
group also means switching the group, hence the listener. As such, when
changing the group we need to update the connection's owner to point to
the listener of the same shard that is bound to the target group.
src/listener.c