fix(http): deliver queued upgrades before earlier responses finish - #68
Merged
Merged
Conversation
|
Hi! I'm the It looks like you correctly set up a CI job that uses the autofix.ci GitHub Action, but the autofix.ci GitHub App has not been installed for this repository. This means that autofix.ci unfortunately does not have the permissions to fix this pull request. If you are the repository owner, please install the app and then restart the CI workflow! 😃 |
steipete
force-pushed
the
claude/w63-queued-upgrade
branch
from
October 2, 2026 04:44
31d2839 to
2cd134f
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
An Upgrade request pipelined behind an unfinished HTTP response was dispatched as a normal request. This deadlocked applications whose upgrade listener finishes the response ahead of it.
Emit upgrade immediately for queued requests, and retain that request's native context and socket handle. Built-in WebSocket adoption waits until the HTTP response pipeline reaches the handoff, then runs on a fresh turn so it cannot replace a socket inside the previous response's native callback. The fork's existing raw-write buffering and pause/resume paths remain in use.
Adapts the dispatch/adoption portions of the open upstream oven-sh#43441 by @robobun. The fork already has the relevant CONNECT and ordered raw-write machinery, so it does not need the upstream transport rewrite. Raw handshake rejection remains immediate, matching the executed Node 24 + npm ws oracle; the negative regressions pin that behavior.
Validation: the standalone queued-upgrade repro passes Node 24, times out on the verified b368 baseline, and passes the candidate with 200 then 101 on the wire. All four new native/npm ws acceptance and rejection regressions fail on b368 and pass after. The surrounding HTTP, CONNECT, WebSocket, pause and socket-end/drain suites pass: 441 passed, 1 skipped, 2 existing todos. The unchanged OpenClaw rejection-transport consumer passes all 18 tests on Linux and Darwin with private HOME/state/TMPDIR; its three queued-upgrade cases failed before. The four native regressions also pass on Darwin, and all 12 cross-target Rust checks pass. Scoped-clean P2 Codex branch review and exact-head build/format/lint gates are required before merge.