BUG/MINOR: stream: properly clear the previous error mask on L7 retries
authorWilly Tarreau <w@1wt.eu>
Fri, 7 May 2021 06:19:30 +0000 (08:19 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 7 May 2021 13:42:26 +0000 (15:42 +0200)
The cleanup of the previous error was incorrect on L7 retries, it would
OR two values while they're part of an enum, leaving some bits set.
Depending on the errors it was possible to occasionally see an internal
error ("I" flag) being logged.

This should be backported as far as 2.0, though the do_l7_retry() function
in in proto_htx.c in older versions.

(cherry picked from commit 75a4284babf50feecac17f9b32d07509b6c519ed)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>

src/http_ana.c

index 9c7d2f5..17bf33e 100644 (file)
@@ -1444,7 +1444,7 @@ static __inline int do_l7_retry(struct stream *s, struct stream_interface *si)
        res->to_forward = 0;
        res->analyse_exp = TICK_ETERNITY;
        res->total = 0;
-       s->flags &= ~(SF_ERR_SRVTO | SF_ERR_SRVCL);
+       s->flags &= ~SF_ERR_MASK;
        si_release_endpoint(&s->si[1]);
        b_free(&req->buf);
        /* Swap the L7 buffer with the channel buffer */