From 13db4bdbc6e60bb54f7583ca76e7d71c97cca96a Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Mon, 29 Aug 2022 11:32:26 +0200 Subject: [PATCH] BUG/MEDIUM: peers: Add connect and server timeut to peers proxy 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/peers.c b/src/peers.c index 642ad1d24..130550545 100644 --- a/src/peers.c +++ b/src/peers.c @@ -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;