]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: proxy: mention that px->conn_retries isn't relevant in some cases
authorAurelien DARRAGON <adarragon@haproxy.com>
Mon, 28 Apr 2025 14:52:33 +0000 (16:52 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 29 Apr 2025 19:21:19 +0000 (21:21 +0200)
Since 91e785edc ("MINOR: stream: Rely on a per-stream max connection
retries value"), px->conn_retries may be ignored in the following cases:

 * proxy not part of a list which gets properly post-init (ie: main proxy
   list, log-forward list, sink list)
 * proxy lacking the CAP_FE capability

Documenting such cases where the px->conn_retries is set but effectively
ignored, so that we either remove ignored statements or fix them in
the future if they are really needed. In fact all cases affected here are
automomous applets that already handle the retries themselves so the fact
that 91e785edc made ->conn_retries ineffective should not be a big deal
anyway.

src/peers.c
src/resolvers.c
src/sink.c

index f6d9ade2c040e440bd185408740290c2a54d2b07..abc00026e30a0a8d1dca26d91d94934b3e0a53b4 100644 (file)
@@ -3237,7 +3237,12 @@ void peers_setup_frontend(struct proxy *fe)
 {
        fe->mode = PR_MODE_PEERS;
        fe->maxconn = 0;
-       fe->conn_retries = CONN_RETRIES;
+       fe->conn_retries = CONN_RETRIES; /* FIXME ignored since 91e785ed
+                                         * ("MINOR: stream: Rely on a per-stream max connection retries value")
+                                         * If this is really expected this should be set on the stream directly
+                                         * because the proxy is not part of the main proxy list and thus
+                                         * lacks the required post init for this setting to be considered
+                                         */
        fe->timeout.connect = MS_TO_TICKS(1000);
        fe->timeout.client = MS_TO_TICKS(5000);
        fe->timeout.server = MS_TO_TICKS(5000);
index 041e91864207a7fe33ee276b3600044466c08eb5..f8378a18b473d20920bc385300b31a4312a0300c 100644 (file)
@@ -3357,6 +3357,12 @@ void resolvers_setup_proxy(struct proxy *px)
 {
        px->maxconn = 0;
        px->conn_retries = 1;
+       px->conn_retries = 1; /* FIXME ignored since 91e785ed
+                              * ("MINOR: stream: Rely on a per-stream max connection retries value")
+                              * If this is really expected this should be set on the stream directly
+                              * because the proxy is not part of the main proxy list and thus
+                              * lacks the required post init for this setting to be considered
+                              */
        px->timeout.server = TICK_ETERNITY;
        px->timeout.client = TICK_ETERNITY;
        px->timeout.connect = 1000; // by default same than timeout.resolve
index ed7195981d799b14e4729bfeda417ce6cb8cfa35..f85f43e55da346c89725b53bd60e6c85df0c25db 100644 (file)
@@ -401,7 +401,11 @@ static int cli_parse_show_events(char **args, char *payload, struct appctx *appc
 void sink_setup_proxy(struct proxy *px)
 {
        px->maxconn = 0;
-       px->conn_retries = 1;
+       px->conn_retries = 1; /* FIXME ignored since 91e785ed
+                              * ("MINOR: stream: Rely on a per-stream max connection retries value")
+                              * If this is really expected this should be set on the stream directly
+                              * because the proxy lacks the CAP_FE so this setting is not considered
+                              */
        px->timeout.server = TICK_ETERNITY;
        px->timeout.client = TICK_ETERNITY;
        px->timeout.connect = TICK_ETERNITY;