]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sink: Only use backend capability for the sink proxies
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Oct 2022 13:10:18 +0000 (15:10 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Oct 2022 14:00:49 +0000 (16:00 +0200)
When a ring section is parsed, a proxy is created. For now, it has the
frontend (PR_CAP_FE) and the internal (PR_CAP_INT) capabilities, in addition
to the expected backend capability (PR_CAP_BE).

PR_CAP_INT capability was added to silent warning triggered because of
PR_CAP_FE capability. Indeed, Because the proxy is declared as a frontend,
warnings about missing bind lines and missing client timeout should be
triggered during the configuration parsing. These warnings are inhibited
because PR_CAP_INT capability is set. It is an issue on the 2.4 because
PR_CAP_INT capability does not exist. So warnings are always emitted.

But the true bug is that these proxies should not have PR_CAP_FE and
PR_CAP_INT capabilities. Removing these capabilities is enough to remove any
warnings on the 2.4, with no regression on higher versions. However, it may
be a good idea to eval if a dedicated frontend for sinks should be added or
not. This way, a true frontend would be used to start the sink applets. In
addition, proxies capabilities/modes have to be reviewed to have a less
ambiguous API. For instance a dedicate mode for sinks (PR_MODE_SINK ?) may
be added. Finally, it could be very nice to have all proxies in the same
list, including internal ones.

This patch should fix the issue #1900. It must be backported as far as 2.4.

src/sink.c

index 23cffc67674e7415c2e3604ec9bd06d20225268f..376f34bbd584af74339cbad1489f38d0a303f625 100644 (file)
@@ -290,7 +290,7 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc
 void sink_setup_proxy(struct proxy *px)
 {
        px->last_change = now.tv_sec;
-       px->cap = PR_CAP_FE | PR_CAP_BE | PR_CAP_INT;
+       px->cap = PR_CAP_BE;
        px->maxconn = 0;
        px->conn_retries = 1;
        px->timeout.server = TICK_ETERNITY;