Skip to content

Commit 5863d33

Browse files
committed
BUG/MINOR: http_ana: Report -1 for %Tr for invalid response only
The server response time is erroneously reported as -1 when it is intercepted by HAProxy. As stated in the documentation, the server response time is reported as -1 when the last response header was never seen. It happens when a server timeout is triggered before the server managed to process the request. It also happens if the response is invalid. This may be reported by the mux during the response parsing, but also by the HTTP analyzers. However, in this last case, the response time must only be reported as -1 on 502. This patch must be backported to all stable versions. It should fix the issue #2384.
1 parent bc96775 commit 5863d33

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/http_ana.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1991,6 +1991,7 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
19911991
goto return_prx_err;
19921992

19931993
return_bad_res:
1994+
s->logs.t_data = -1; /* was not a valid response */
19941995
txn->status = 502;
19951996
stream_inc_http_fail_ctr(s);
19961997
_HA_ATOMIC_INC(&s->be->be_counters.failed_resp);
@@ -2006,7 +2007,6 @@ int http_process_res_common(struct stream *s, struct channel *rep, int an_bit, s
20062007
/* fall through */
20072008

20082009
return_prx_cond:
2009-
s->logs.t_data = -1; /* was not a valid response */
20102010
s->scb->flags |= SC_FL_NOLINGER;
20112011

20122012
http_set_term_flags(s);

0 commit comments

Comments
 (0)