BUG/MAJOR: mux-h1: Wake SC to perform 0-copy forwarding in CLOSING state
authorChristopher Faulet <cfaulet@haproxy.com>
Mon, 9 Sep 2024 16:19:54 +0000 (18:19 +0200)
committerWilly Tarreau <w@1wt.eu>
Mon, 9 Sep 2024 17:44:33 +0000 (19:44 +0200)
commit0be5e36d8c823164baf0b0ae98cc66936a2034b8
treef436f72aaaefddb2ee2383d4d6b39f888a20db90
parentfc0af6f2bb0bf99d9c84e888e3daaa5529da2a5c
BUG/MAJOR: mux-h1: Wake SC to perform 0-copy forwarding in CLOSING state

When the mux is woken up on I/O events, if the zero-copy forwarding is
enabled, receives are blocked. In this case, the SC is woken up to be able
to perform 0-copy forwarding to the other side. This works well, except for
the H1C in CLOSING state.

Indeed, in that case, in h1_process(), the SC is not woken up because only
RUNNING H1 connections are considered. As consequence, the mux will ignore
connection closure. The H1 connection remains blocked, waiting for the
shutdown timeout. If no timeout is configured, the H1 connection is never
closed leading to a leak.

This patch should fix leak reported by Damien Claisse in the issue #2697. It
should be backported as far as 2.8.

(cherry picked from commit f6e193f1b05bc3a73090b1efeb3f0440a0c776b0)
Signed-off-by: Willy Tarreau <w@1wt.eu>
src/mux_h1.c