]> dgit.raspbian.org Git - haproxy.git/commit
[PATCH] BUG/MAJOR: mux-h2: properly handle short reads on PING frames
authorWilly Tarreau <w@1wt.eu>
Mon, 12 Oct 2026 12:38:34 +0000 (14:38 +0200)
committerVincent Bernat <bernat@debian.org>
Sat, 17 Oct 2026 17:17:39 +0000 (19:17 +0200)
commit5320a627ad45a2328dfb0f8206cee21f274f65cb
tree53e584f1e1de8a6ba387ecfee409e40c2adfe551
parentd441b988cc37e6ffc5151aa47af3041144e3390e
[PATCH] BUG/MAJOR: mux-h2: properly handle short reads on PING frames

Handling of partially received H2 frames was fixed in 2.5 with commit
b5f7b52968 ("BUG/MEDIUM: mux-h2: Handle remaining read0 cases on partial
frames"), however it turns out that the PING one was apparently missed.
However by then it was not a problem, but became one when commit 633c41c62
("MEDIUM: mux-h2: rework h2_restart_reading() to differentiate recv and
demux") was merged in 3.1 because now the mux's tasklet can properly wake
up as long as the job is not finished, which unfortunately doesn't play
well once combined with the fix above, because as long as the data are
not consumed, we continue to wake up, and we don't consume them until
the frame is complete, or the timeout http-request strikes.

Let's simply implement the check for the short read in h2c_handle_ping()
to avoid the spurious wakeup.

This needs to be backported to 3.2, maybe even 2.6 since the checks in
other functions didn't change since then.

As a workaround, setting "timeout http-request" to a low value such as
1-5s mitigates the CPU consumption.

(cherry picked from commit 7ddb55bc18744996782e9e2b50f16b9b985d766b)
Signed-off-by: Willy Tarreau <w@1wt.eu>
Gbp-Pq: Name 0001-BUG-MAJOR-mux-h2-properly-handle-short-reads-on-PING.patch
src/mux_h2.c