From bc6b23813fd2b0cf08ee9051f00ed9986ed1036e Mon Sep 17 00:00:00 2001 From: Christopher Faulet Date: Wed, 3 Aug 2022 10:47:48 +0200 Subject: [PATCH] BUG/MINOR: backend: Don't increment conn_retries counter too early The connection retry counter is incremented too early when a connection fails. In SC_ST_CER state, errors handling must be performed before incrementing the counter. Otherwise, we may consider the max connection attempt is reached while a last one is in fact possible. This patch must be backported to 2.6. --- src/backend.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend.c b/src/backend.c index 2ae76002b..672604601 100644 --- a/src/backend.c +++ b/src/backend.c @@ -2293,8 +2293,6 @@ void back_handle_st_cer(struct stream *s) s->conn_exp = TICK_ETERNITY; s->flags &= ~SF_CONN_EXP; - s->conn_retries++; - /* we probably have to release last stream from the server */ if (objt_server(s->target)) { struct connection *conn = sc_conn(sc); @@ -2389,6 +2387,7 @@ void back_handle_st_cer(struct stream *s) goto end; } + s->conn_retries++; stream_choose_redispatch(s); if (must_tar) {