From: Christopher Faulet Date: Fri, 15 Nov 2024 09:51:18 +0000 (+0100) Subject: BUG/MINOR: Don't report early srv aborts on request forwarding in DONE state X-Git-Tag: v3.1-dev13~13 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a930e99f4699676ea72f72ba1fb99c953da0d74e;p=thirdparty%2Fhaproxy.git BUG/MINOR: Don't report early srv aborts on request forwarding in DONE state L7-retries may be ignored if server aborts are detected during the request forwarding, when the request is already in DONE state. When a request was fully processed (so in HTTP_MSG_DONE state) and is waiting for be forwarded to the server, there is a test to detect server aborts, to be able to report the error. However, this test must be skipped if the response was not received yet, to let the reponse analyszers handle the abort. It is important to properly handle the retries. This test must only be performed if the response analysis was finished. It means the response must be at least in HTTP_MSG_BODY state. This patch should be backported as far as 2.8. --- diff --git a/src/http_ana.c b/src/http_ana.c index ecf417e5a1..ca05a146f1 100644 --- a/src/http_ana.c +++ b/src/http_ana.c @@ -1012,7 +1012,7 @@ int http_request_forward_body(struct stream *s, struct channel *req, int an_bit) * response. Otherwise, let a change to forward the response * first. */ - if (htx_is_empty(htxbuf(&s->res.buf))) { + if (txn->rsp.msg_state >= HTTP_MSG_BODY && htx_is_empty(htxbuf(&s->res.buf))) { COUNT_IF(1, "Server abort during request forwarding"); goto return_srv_abort; }