BUG/MEDIUM: mux-h1: Wakeup H1C on shutw if there is no I/O subscription
authorChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Mar 2023 08:26:16 +0000 (09:26 +0100)
committerChristopher Faulet <cfaulet@haproxy.com>
Fri, 24 Mar 2023 13:38:35 +0000 (14:38 +0100)
commit551b89677249b2107a6e4c40a0b61d01c9da6831
treebb2b86b63b052e2ddcdf18280c1b77d532765f63
parentfedbc17a5e40bfa6b8a6ed1417d22410f925eddb
BUG/MEDIUM: mux-h1: Wakeup H1C on shutw if there is no I/O subscription

This old bug was revealed because of the commit 407210a34 ("BUG/MEDIUM:
stconn: Don't rearm the read expiration date if EOI was reached"). But it is
still possible to hit it if there is no server timeout. At first glance, the
2.8 is not affected. But the fix remains valid.

When a shutdown for writes if performed the H1 connection must be notified
to be released. If it is subscribed for any I/O events, it is not an
issue. But, if there is no subscription, no I/O event is reported to the H1
connection and it remains alive. If the message was already fully received,
nothing more happens.

On my side, I was able to trigger the bug by freezing the session. Some
users reported a spinning loop on process_stream(). Not sure how to trigger
the loop. To freeze the session, the client timeout must be reached while
the server response was already fully received. On old version (< 2.6), it
only happens if there is no server timeout.

To fix the issue, we must wake up the H1 connection on shutdown for writes
if there is no I/O subscription.

This patch must be backported as far as 2.0. It should fix the issue #2090
and #2088.
src/mux_h1.c