Repository navigation
fix(tokio): WebSocket upgrade edge cases #4296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
kixelated
merged 6 commits into
quest/m1/transport-upgrade/README
from
quest/m1/transport-upgrade/polish
Oct 1, 2026
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
abc5f71
quest(transport-upgrade): claim polish
kixelated 54e1787
fix(tokio): fall back to the pending QUIC dial when the WebSocket han…
kixelated cacaf25
quest(transport-upgrade): add closed-fallback and js-qmux-finish foll…
kixelated 3d38d33
fix(tokio): classify a double handshake failure as a race loss
kixelated e156cd0
Merge remote-tracking branch 'origin/quest/m1/transport-upgrade/READM…
kixelated b4eaf83
fix(tokio): keep a QUIC error that predates the WebSocket win
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| # [S] Fall back to QUIC when the WebSocket session closes at once | ||
|
|
||
| ## Goal | ||
|
|
||
| When WebSocket wins the dial race and its session closes right after | ||
| connecting, the `Connection` moves onto the QUIC dial that is still pending | ||
| instead of dropping it and redialing. On moq-lite and IETF draft 17+ the | ||
| client handshake does not wait for the server, so a server refusing the | ||
| WebSocket session looks like this rather than like a handshake failure, which | ||
| already falls back. | ||
|
|
||
| ## Plan | ||
|
|
||
| - Today `run_session` in `moq-tokio`'s `connection.rs` returns when the | ||
| WebSocket session closes, and the pending upgrade is dropped. The redial | ||
| starts a fresh QUIC dial and has lost QUIC's head start. | ||
| - Decide what counts as "at once". The unhealthy-session threshold that | ||
| already feeds the backoff may be the right line. Keep the connect deadline | ||
| that bounds the pending dial as the only deadline. | ||
| - An auth close on the WebSocket session is probably still terminal, the way | ||
| it is for a lone session. Check how the race treats a mixed auth pair and | ||
| match it. | ||
| - Test with the held-QUIC forwarder in the connection tests, as the handshake | ||
| fallback test does, with a default moq-lite client. | ||
|
|
||
| Public API: none. Wire: none. | ||
|
|
||
| ## Related | ||
|
|
||
| - [#4296](https://github.com/moq-dev/moq/pull/4296) - the handshake-failure fallback this extends |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| # [XS] Clean finish in @moq/qmux | ||
|
|
||
| ## Goal | ||
|
|
||
| `@moq/qmux` reports a send stream that finished cleanly as closed without | ||
| error, so `@moq/net` does not treat a delivered GOAWAY or SETUP as a failure | ||
| over the WebSocket fallback. | ||
|
|
||
| ## Plan | ||
|
|
||
| The Rust qmux crate reported every finished stream as `connection closed` | ||
| (fixed in moq-dev/web-transport#402). Check whether the TypeScript peer in | ||
| `moq-dev/web-transport` (`js/qmux`) has the same bug, and whether `@moq/net` | ||
| waits on a finished writable anywhere it would notice. If it does, fix it | ||
| there with a regression test, release, and bump `@moq/qmux` in `js/net`. If | ||
| not, note that in the PR that deletes this quest. | ||
|
|
||
| Public API: none. Wire: none. | ||
|
|
||
| ## Related | ||
|
|
||
| - [JavaScript upgrade](/quest/m1/transport-upgrade/js.md) - sends a GOAWAY over the WebSocket session on every upgrade |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing the Rust edge-case quest leaves its GOAWAY-warning goal unresolved: the reviewed tree still pins
qmux = 0.5.1inCargo.toml, while the commit description states that the clean-finish fix will only arrive with qmux 0.6. Consequently every WebSocket-to-QUIC upgrade can still emit the falsefailed to send goawaywarning fromrs/moq-net/src/lite/session.rs; keep this quest open or include the dependency update and regression coverage.AGENTS.md reference: AGENTS.md:L16-L18
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed. qmux 0.6.0 is not published yet (moq-dev/web-transport#402 is still open), so this PR is blocked on that release and will not merge until the qmux bump lands here.
(Written by Claude Opus 5.5)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done: qmux 0.6.1 (with web-transport#399, #401, #402) arrived through a dev merge into the questline (c57de66), and
websocket_upgrades_to_quicnow assertsfailed to send goawaynever logs (20 of 20 runs clean).(Written by Claude Opus 5.5)