]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: streams: Remove SF_ADDR_SET if we're retrying due to L7 retry.
authorOlivier Houchard <cognet@ci0.org>
Tue, 12 May 2020 20:18:14 +0000 (22:18 +0200)
committerOlivier Houchard <cognet@ci0.org>
Wed, 13 May 2020 17:02:38 +0000 (19:02 +0200)
In do_l7_retry(), remove the SF_ADDR_SET flag. Otherwise,
assign_server_address() won't be called again, which means for 2.1 or 2.2,
we will always retry to connect to the server that just failed, and for 2.0,
that we will try to use to whatever the address is for the connection,
probably the last server used by that connection before it was pool_free()
and reallocated.

This should be backported to 2.1 and 2.0.

src/http_ana.c

index 46858c8674aa519692cf0627bc8de9fb55a30abf..f6e0eca3b2cf3d8c586a71bcb4409eef4ce73f98 100644 (file)
@@ -1424,6 +1424,7 @@ static __inline int do_l7_retry(struct stream *s, struct stream_interface *si)
        res->flags &= ~(CF_READ_ERROR | CF_READ_TIMEOUT | CF_SHUTR | CF_EOI | CF_READ_NULL | CF_SHUTR_NOW);
        res->analysers = 0;
        si->flags &= ~(SI_FL_ERR | SI_FL_EXP | SI_FL_RXBLK_SHUT);
+       s->flags &= ~SF_ADDR_SET;
        stream_choose_redispatch(s);
        si->exp = TICK_ETERNITY;
        res->rex = TICK_ETERNITY;