Repository navigation
Conversation
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.
AI assistance: The implementation and regression tests were developed with Codex, with a separate agent reviewing the cancellation path.
Problem
A pending
fetch_read_bodycall retains anArcto the response while awaitingResponse::chunk(). Closing its resource-table entry alone does not interrupt that operation. When a streaming server stays silent, cancellation therefore waits for another chunk; in the local HTTP/1.1 reproduction, the server also keeps seeing an open connection.Closes #3713.
Solution and key decisions
Mutex<Option<Response>>, dropping it on cancellation, EOF or error. This also replaces the raw mutable Arc cast and serializes concurrent reads.http/http-jspatch entries and streaming cancellation documentation.Tests
macOS arm64, stable Rust 1.97.1 and MSRV 1.90.0, using the checked-in lockfile:
cargo fmt --all --check; HTTP guest Rollup build, ESLint and TypeScript; documentation format, paired changeset and license checks pass.cargo test --docsucceeds with 0 doctests.Risks and follow-up
No native webview/IPC, Linux, Windows or mobile execution is claimed. HTTP/2 stream cancellation and TLS-specific transport behavior are not independently exercised by these tests; dropping a response does not imply closing a shared HTTP/2 TCP connection.
ResourceTable::cleardoes not callResource::close, so this change does not claim to fix webview teardown with outstanding reads. Upstream platform CI and maintainer review remain to be completed.