1 commit 48cd95b6a516562af382930adcc0eabfdb652487
2 Author: Christopher Faulet <cfaulet@haproxy.com>
3 Date: Thu Jan 9 14:31:13 2020 +0100
5 BUG/MINOR: stream-int: Don't trigger L7 retry if max retries is already reached
7 When an HTTP response is received, at the stream-interface level, if a L7 retry
8 must be triggered because of the status code, the response is trashed and a read
9 error is reported on the response channel. Then the stream handles this error
10 and perform the retry. Except if the maximum connection retries is reached. In
11 this case, an error is reported. Because the server response was already trashed
12 by the stream-interface, a generic 502 error is returned to the client instead
15 Now, the stream-interface triggers a L7 retry only if the maximum connection
16 retries is not already reached. Thus, at the end, the last server's response is
19 This patch must be backported to 2.1 and 2.0. It should fix the issue #439.
21 (cherry picked from commit 48726b78e57a69bfcdce624a3a5905c781d5eec0)
22 Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
24 diff --git a/src/stream_interface.c b/src/stream_interface.c
25 index 1d84ca9ad..012ac71e0 100644
26 --- a/src/stream_interface.c
27 +++ b/src/stream_interface.c
28 @@ -1372,7 +1372,8 @@ int si_cs_recv(struct conn_stream *cs)
32 - if (si->flags & SI_FL_L7_RETRY) {
33 + /* L7 retries enabled and maximum connection retries not reached */
34 + if ((si->flags & SI_FL_L7_RETRY) && si->conn_retries) {