]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUG/MEDIUM: http-ana: Don't close request side when waiting for response
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Mar 2023 15:03:17 +0000 (16:03 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 1 Mar 2023 16:35:16 +0000 (17:35 +0100)
A recent fix (af124360e "BUG/MEDIUM: http-ana: Detect closed SC on opposite side
during body forwarding") was pushed to handle to sync a side when the opposite
one is in closing state. However, sometimes, the synchro is performed too early,
preventing a L7 retry to be performed.

Indeed, while the above fix is valid on the reponse side. On the request side,
if the response was not yet received, we must wait before closing.

So, to fix the fix, on the request side, we at least wait the response was
received before finishing the request analysis. Of course, if there is an error,
an abort or anything wrong on the server side, the response analyser should
handle it.

This patch is related to #2061. No backport needed.

src/http_ana.c

index f0c08598088beb7e6eff5a7a1e1259b5e52b9f25..bd2be1b5b20a06a2681048bbacadbf4081e08e04 100644 (file)
@@ -4235,7 +4235,8 @@ static void http_end_request(struct stream *s)
                 */
                chn->flags |= CF_NEVER_WAIT;
 
-               if (txn->rsp.msg_state < HTTP_MSG_DONE && s->scb->state != SC_ST_CLO) {
+               if (txn->rsp.msg_state < HTTP_MSG_BODY ||
+                   (txn->rsp.msg_state < HTTP_MSG_DONE && s->scb->state != SC_ST_CLO)) {
                        /* The server has not finished to respond and the
                         * backend SC is not closed, so we don't want to move in
                         * order not to upset it.