]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: peers: Add connect and server timeut to peers proxy
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 29 Aug 2022 09:32:26 +0000 (11:32 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Mon, 29 Aug 2022 09:38:02 +0000 (11:38 +0200)
Only the client timeout was set. Nothing prevent a peer applet to stall
during a connect or waiting a message from a remote peer. To avoid any
issue, it is important to also set connection and server timeouts. The
connect timeout is set to 1s and the server timeout is set to 5s.

This patch must be backported to all supported versions.

src/peers.c

index 642ad1d24c050d5abe64544c26154cf10d4d0582..130550545159eda39340b330a37b1230dab365ae 100644 (file)
@@ -3211,7 +3211,9 @@ void peers_setup_frontend(struct proxy *fe)
        fe->mode = PR_MODE_PEERS;
        fe->maxconn = 0;
        fe->conn_retries = CONN_RETRIES;
+       fe->timeout.connect = MS_TO_TICKS(1000);
        fe->timeout.client = MS_TO_TICKS(5000);
+       fe->timeout.server = MS_TO_TICKS(5000);
        fe->accept = frontend_accept;
        fe->default_target = &peer_applet.obj_type;
        fe->options2 |= PR_O2_INDEPSTR | PR_O2_SMARTCON | PR_O2_SMARTACC;