]> git.kaiwu.me - haproxy.git/commitdiff
BUG/MINOR: http-ana: also set FINAL on http-response actions on server error
authorChristopher Faulet <cfaulet@haproxy.com>
Wed, 4 Nov 2026 08:47:04 +0000 (09:47 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 5 Nov 2026 17:20:59 +0000 (18:20 +0100)
http_res_get_intercept_rule() stops http-response actions from yielding once
the client side is dead: when the frontend connector reports an error or an
early close, the action is called with ACT_OPT_FINAL, so a yield is refused
and the caller receives an HTTP_RULE_RES_ERROR instead of being left waiting
forever.

The server side was missing: when the backend connector reports an error
while an http-response action (e.g. send-spoe-group) is yielding, the action
kept waiting for a wakeup that would only ever come from the server it just
lost, and the response was stuck in the channel until the client timed out.

Add the missing server-side condition: an SC_FL_ERROR on the backend
connector also sets ACT_OPT_FINAL, so http-response actions get a final
chance to conclude when the server dies. Combined with the previous commit,
the "server answered early and reset its stream while the action was
pending" case from github issue #3559 now lets the action conclude with an
error instead of hanging the response.

This patch should be backported to all supported versions.

src/http_ana.c

index a75c41a24efb1f23307a72f0a449d286fa3c6719..1afa11b65cd8d999fbb3c8ff0051792cae368059 100644 (file)
@@ -3047,7 +3047,7 @@ static enum rule_result http_res_get_intercept_rule(struct proxy *px, struct lis
 
        if (final)
                act_opts |= ACT_OPT_FINAL;
-       if ((s->scf->flags & SC_FL_ERROR) ||
+       if ((s->scf->flags & SC_FL_ERROR) || (s->scb->flags & SC_FL_ERROR) ||
            ((s->scf->flags & SC_FL_EOS) && proxy_abrt_close_def(px, 1)))
                act_opts |= ACT_OPT_FINAL | ACT_OPT_FINAL_EARLY;