BUG/MEDIUM: http-ana: Report error on write error waiting for the response
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 1 Aug 2024 13:42:09 +0000 (15:42 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Tue, 3 Sep 2024 16:33:26 +0000 (18:33 +0200)
commitaa43ed1719048dfee36594e13f15c2ccd397c9db
tree60dfe6b88e575d1bdd490e22b9e3928cf2222606
parent0a06f5f5aefdba68c675f9c2bf55dad093f800e7
BUG/MEDIUM: http-ana: Report error on write error waiting for the response

When we are waiting for the server response, if an error is pending on the
frontend side (a write error on client), it is handled as an abort and all
regular response analyzers are removed, except the one responsible to
release the filters, if any. However, while it is handled as an abort, the
error is not reported, as usual, via http_reply_and_close() function. It is
an issue because in that, the channels buffers are not reset.

Because of this bug, it is possible to block a stream infinitely. The
request side is waiting for the response side and the response side is
blocked because filters must be released and this cannot be done because
data remain blocked in channels buffers.

So, in that case, calling http_reply_and_close() with no message is enough
to unblock the stream.

This patch must be backported as far as 2.8.

(cherry picked from commit 0ba6202796fe24099aeff89a5a4b83af99fc027b)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_ana.c