]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MINOR: stream: Reset stream final state and si error type on L7 retry
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 5 May 2021 19:05:09 +0000 (21:05 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 May 2021 10:00:56 +0000 (12:00 +0200)
Thanks to a previous fix, the stream error mask is now cleared on L7
retry. But the stream final state (SF_FINST_*) and the stream-interface
error type must also be reset to properly restart a new connection and be
sure to not inherit errors from the previous connection attempt.

In addition, SF_ADDR_SET flag is not systematically removed.
stream_choose_redispatch() already takes care to unset it if necessary. When
the connection is not redispatch, the server address can be preserved.

This patch must be backported as far as 2.0.

src/http_ana.c

index bed8d09b491f62cc8a3ef9abeb13d0d0a591b1dd..b35664645dd7b9eb0d9eb43a62cda41280111bd3 100644 (file)
@@ -1309,14 +1309,14 @@ 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;
+       si->err_type = SI_ET_NONE;
+       s->flags &= ~(SF_ERR_MASK | SF_FINST_MASK);
        stream_choose_redispatch(s);
        si->exp = TICK_ETERNITY;
        res->rex = TICK_ETERNITY;
        res->to_forward = 0;
        res->analyse_exp = TICK_ETERNITY;
        res->total = 0;
-       s->flags &= ~SF_ERR_MASK;
        si_release_endpoint(&s->si[1]);
 
        b_reset(&req->buf);