BUG/MEDIUM: http-ana: Drain request data waiting the tarpit timeout expiration
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 29 Oct 2021 12:37:07 +0000 (14:37 +0200)
committerChristopher Faulet <cfaulet@haproxy.com>
Wed, 3 Nov 2021 15:21:31 +0000 (16:21 +0100)
commitc73b4f450a792ce5aae7ee42d70530472544462c
tree7b3fb4722ebd2853d8ec33a024f18133b04d05a1
parent900608fde1d468ff027f0477352445dc90ceec79
BUG/MEDIUM: http-ana: Drain request data waiting the tarpit timeout expiration

When a tarpit action is performed, we must be sure to drain data from the
request channel. Otherwise, the mux on the frontend side may be blocked
because the request channel buffer is full.

This may lead to Two bugs. The first one is a HOL blocking on the H2
multiplexer. A tarpitted stream may block all the others because data are
not drained for the whole tarpit timeout. The second bug is a ping-pong loop
between the multiplexer and the stream. The mux is waiting for more space in
the channel buffer, so it wakes up the stream. And the stream systematically
re-enables receives.

This last part is not pretty clean and it will be addressed with another
fix. But draning request data is a good way to fix both bugs in same time.

This patch must be backported as far as 2.0. The legacy HTTP mode is
probably affected, but I don't know if same bugs may be experienced in this
mode.

(cherry picked from commit b0c87f1c61edbc4e4affd81d2fd02e113528cf03)
Signed-off-by: Willy Tarreau <w@1wt.eu>
(cherry picked from commit b02d5f024ee379102320e6fe514aa902d1b26a47)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
src/http_ana.c