]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: don't force retries if the server is DOWN
authorWilly Tarreau <w@1wt.eu>
Wed, 13 Jan 2016 06:58:44 +0000 (07:58 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 25 Jan 2016 13:36:20 +0000 (14:36 +0100)
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.

src/stream.c

index 0d18f9c2fd7334bbfed6c22bc8d35b62b33ff7c5..fe48be428d86873c06035c10131fe9584d87cde1 100644 (file)
@@ -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) &&