]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
MINOR: mworker/threads: limit the mworker sockets to group 1
authorWilly Tarreau <w@1wt.eu>
Wed, 6 Jul 2022 09:46:34 +0000 (11:46 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 15 Jul 2022 17:43:10 +0000 (19:43 +0200)
As a side effect of commit 34aae2fd1 ("MEDIUM: mworker: set the iocb of
the socketpair without using fd_insert()"), a config may now refuse to
start if there are multiple groups configured because the default bind
mask may span over multiple groups, and it is not possible to force it
to work differently.

Let's just assign thread group 1 to the master<->worker sockets so that
the thread bindings automatically resolve to a single group. The same was
done for the master side of the socket even if it's not used. It will
avoid being forgotten in the future.

src/cli.c

index 485c096622d7141ad6a9b6de594b41443a23b4a8..abec46bf9cf366c4d74562647e329f12574e68ad 100644 (file)
--- a/src/cli.c
+++ b/src/cli.c
@@ -3009,6 +3009,7 @@ int mworker_cli_proxy_new_listener(char *line)
        bind_conf->level &= ~ACCESS_LVL_MASK;
        bind_conf->level |= ACCESS_LVL_ADMIN;
        bind_conf->level |= ACCESS_MASTER | ACCESS_MASTER_ONLY;
+       bind_conf->bind_tgroup = 1; // bind to a single group in any case
 
        if (!str2listener(args[0], mworker_proxy, bind_conf, "master-socket", 0, &err)) {
                ha_alert("Cannot create the listener of the master CLI\n");
@@ -3106,6 +3107,7 @@ int mworker_cli_sockpair_new(struct mworker_proc *mworker_proc, int proc)
        bind_conf->level &= ~ACCESS_LVL_MASK;
        bind_conf->level |= ACCESS_LVL_ADMIN; /* TODO: need to lower the rights with a CLI keyword*/
        bind_conf->level |= ACCESS_FD_LISTENERS;
+       bind_conf->bind_tgroup = 1; // bind to a single group in any case
 
        if (!memprintf(&path, "sockpair@%d", mworker_proc->ipc_fd[1])) {
                ha_alert("Cannot allocate listener.\n");