]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: sink: Set default connect/server timeout for implicit ring buffers
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Oct 2022 13:53:01 +0000 (15:53 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 24 Oct 2022 14:00:49 +0000 (16:00 +0200)
Ring buffers may be implicitly created from log declarations when "tcp@",
"tcp6@", "tcp4@" or "uxst@" prefixes are used. These ring buffers rely on
unconfigurable proxies. While connect and server timeouts should be defined for
explicit ring buffers, it is no possible for implicit ones. However, a default
value must be set and TICK_ETERNITY is not an acceptable one.

Thus, now "1s" is set for the connect timeout and "5s" is set for server one.

This patch may be backported as far as 2.4.

src/sink.c

index 376f34bbd584af74339cbad1489f38d0a303f625..de1e9cfbf441f4081840e4c64212218321d8c58b 100644 (file)
@@ -1095,6 +1095,10 @@ struct sink *sink_new_from_logsrv(struct logsrv *logsrv)
        p->conf.args.file = p->conf.file = strdup(logsrv->conf.file);
        p->conf.args.line = p->conf.line = logsrv->conf.line;
 
+       /* Set default connect and server timeout */
+       p->timeout.connect = MS_TO_TICKS(1000);
+       p->timeout.server = MS_TO_TICKS(5000);
+
        /* allocate a new server to forward messages
         * from ring buffer
         */