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>
Fri, 29 Oct 2021 13:06:31 +0000 (15:06 +0200)
commitb0c87f1c61edbc4e4affd81d2fd02e113528cf03
tree8a48d06979aea50eea3854f258c0bd89956f3d88
parentbce6db6c3c208191e8c1962e3ded0dbfc015d052
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.
src/http_ana.c