From: Willy Tarreau Date: Wed, 13 Jan 2016 06:58:44 +0000 (+0100) Subject: BUG/MINOR: stream: don't force retries if the server is DOWN X-Git-Tag: v1.7-dev2~134 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=49008c157e762c7ed31f9c88ad54b6d6c42fbd77;p=thirdparty%2Fhaproxy.git BUG/MINOR: stream: don't force retries if the server is DOWN Arkadiy Kulev noticed that if a server is marked down while a connection is being trying to establish, we still insist on performing retries on the same server, which is absurd. Better perform the redispatch if we already know the server is down. Because of this, it's likely that the observe-l4 and sudden-death mechanisms are not optimal an cannot help much the connection which was used to detect the problem. The fix should be backported to 1.6 and 1.5 at least. --- diff --git a/src/stream.c b/src/stream.c index 0d18f9c2fd..fe48be428d 100644 --- a/src/stream.c +++ b/src/stream.c @@ -667,7 +667,8 @@ static int sess_update_st_cer(struct stream *s) */ if (objt_server(s->target) && (s->be->options & PR_O_REDISP) && !(s->flags & SF_FORCE_PRST) && - ((((s->be->redispatch_after > 0) && + ((__objt_server(s->target)->state < SRV_ST_RUNNING) || + (((s->be->redispatch_after > 0) && ((s->be->conn_retries - si->conn_retries) % s->be->redispatch_after == 0)) || ((s->be->redispatch_after < 0) &&