Skip to content

fix(mux): refresh the backend-work flag after the frontend write - #1773

Merged
FlorentinDUBOIS merged 1 commit into
mainfrom
fix/mux-1xx-rearm-backend-loop
Oct 1, 2026
Merged

FlorentinDUBOIS merged 1 commit into
mainfrom
fix/mux-1xx-rearm-backend-loop

Conversation

@FlorentinDUBOIS

@FlorentinDUBOIS FlorentinDUBOIS commented Oct 1, 2026 •

Copy link
Copy Markdown
Collaborator

With an HTTP/2 frontend in front of an HTTP/1.1 backend that writes interim responses and the final response at once, the client got the interim HEADERS and the final response stalled until the backend hung up.

Mux::ready_inner recorded whether any backend had work before the frontend write. Forwarding a 1xx re-arms the backend read (ConnectionH2::handle_1xx_reset, ConnectionH1::writable's interim arms) so the bytes already buffered behind it get parsed, but only a resumed parked backend refreshed that record, so the loop could exit with a backend armed and no socket event left to wake it.

Fix: refresh the record from every backend's readiness after the frontend write. RFC 9110 §15.2.

Tests (e2e): test_h2_to_h1_103_and_final_in_one_write, test_h2_to_h1_102_103_and_final_in_one_write; the backend keeps its connection open, so only the buffered bytes can deliver the final response.

Fixes #1771

Mux::ready_inner recorded whether any backend had work before the
frontend write. Forwarding an interim 1xx re-arms the backend read
(ConnectionH2::handle_1xx_reset, ConnectionH1::writable's interim arms)
so the response bytes already buffered behind it get parsed, but only a
resumed parked backend refreshed the flag. With an H2 frontend the loop
then exited with the backend armed and no socket event left to wake it,
and a final response written by an H1 backend together with its 1xx
stalled until the backend hung up. The flag is now refreshed from every
backend's readiness after the frontend write. RFC 9110 section 15.2.

Fixes #1771

Signed-off-by: Florentin Dubois <[email protected]>
@FlorentinDUBOIS
FlorentinDUBOIS force-pushed the fix/mux-1xx-rearm-backend-loop branch from 2d7f31e to b929629 Compare October 1, 2026 20:09
@FlorentinDUBOIS
FlorentinDUBOIS merged commit 4396fe2 into main Oct 1, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(mux): final response after a 1xx stalls behind an H2 frontend

1 participant