BUG/MEDIUM: http-ana: Try to handle response before handling server abort
authorChristopher Faulet <cfaulet@haproxy.com>
Thu, 14 Sep 2023 09:12:32 +0000 (11:12 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Thu, 21 Sep 2023 07:36:37 +0000 (09:36 +0200)
commitd3e379b3ce8b0bf6bb167bb1f06268edb5406284
treea425104f81bea4c5717aef174268c37d94b76521
parentcbbee154629d584b7af490c4ee3c317884578414
BUG/MEDIUM: http-ana: Try to handle response before handling server abort

In the request analyser responsible to forward the request, we try to detect
the server abort to stop the request forwarding. However, we must be careful
to not block the response processing, if any. Indeed, it is possible to get
the response and the server abort in same time. In this case, we must try to
forward the response to the client first.

So to fix the issue, in the request analyser we no longer handle the server
abort if the response channel is not empty. In the end, the response
analyser is able to detect the server abort if it is relevant. Otherwise,
the stream will be woken up after the response forwarding and the server
abort should be handled at this stage.

This patch should be backported as far as 2.7 only because the risk of
breakage is high. And it is probably a good idea to wait a bit before
backporting it.
src/http_ana.c