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.
This commit is contained in:
Christopher Faulet 2022-08-03 10:47:48 +02:00
parent 14a60d420a
commit bc6b23813f

View File

@ -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) {