BUG/MEDIUM: http-ana: Report 502 from req analyzer only during rsp forwarding
authorChristopher Faulet <cfaulet@haproxy.com>
Tue, 15 Apr 2025 06:18:48 +0000 (08:18 +0200)
committerAurelien DARRAGON <adarragon@haproxy.com>
Tue, 15 Apr 2025 16:37:48 +0000 (18:37 +0200)
commitc0d92e80821a4af654c6a4230fa9ab24b35f9ee4
treedc9cc5c930cd25c4686e925cfcf5f65e69bffec3
parentd99407770db42ac27f488093e9b419cd0839e48f
BUG/MEDIUM: http-ana: Report 502 from req analyzer only during rsp forwarding

A server abort must be handled by the request analyzers only when the
response forwarding was already started. Otherwise, it it the responsability
of the response analyzer to detect this event. L7-retires and conditions to
decide to silently close a client conneciotn are handled by this analyzer.

Because a reused server connections closed too early could be detected at
the wrong place, it was possible to get a 502/SH instead of a silent close,
preventing the client to safely retries its request.

Thanks to this patch, we are able to silently close the client connection in
this case and eventually to perform a L7 retry.

This patch must be backported as far as 2.8.

(cherry picked from commit d160046e2c9caae7deff5d59abc9694b6e664446)
[ada: ctx adjt since COUNT_IF counters are still there in 3.1]
Signed-off-by: Aurelien DARRAGON <adarragon@haproxy.com>
src/http_ana.c