diff --git a/src/stream.c b/src/stream.c index c0f4b070c..b66322752 100644 --- a/src/stream.c +++ b/src/stream.c @@ -798,7 +798,9 @@ static int sess_update_st_cer(struct stream *s) /* The error was an asynchronous connection error, and we will * likely have to retry connecting to the same server, most * likely leading to the same result. To avoid this, we wait - * MIN(one second, connect timeout) before retrying. + * MIN(one second, connect timeout) before retrying. We don't + * do it when the failure happened on a reused connection + * though. */ int delay = 1000; @@ -810,9 +812,9 @@ static int sess_update_st_cer(struct stream *s) si->err_type = SI_ET_CONN_ERR; /* only wait when we're retrying on the same server */ - if (si->state == SI_ST_ASS || - (s->be->lbprm.algo & BE_LB_KIND) != BE_LB_KIND_RR || - (s->be->srv_act <= 1)) { + if ((si->state == SI_ST_ASS || + (s->be->lbprm.algo & BE_LB_KIND) != BE_LB_KIND_RR || + (s->be->srv_act <= 1)) && !(s->flags & SF_SRV_REUSED)) { si->state = SI_ST_TAR; si->exp = tick_add(now_ms, MS_TO_TICKS(delay)); }