fix(runtime): return proxied responses at headers instead of body EOF - #2159
Merged
jackwener merged 3 commits intoAug 4, 2026
Merged
Conversation
Benjamin-eecs
marked this pull request as ready for review
August 4, 2026 13:51
proxiedFetch awaited dispatcher.close() in a finally block before the outer promise could resolve, so a streaming response through a proxy was withheld until its body reached EOF. Return the Response as soon as headers arrive and tie cleanup to the returned body's lifecycle instead: the re-wrapped body reports when it reaches EOF, errors, or is cancelled; the caller abort listener detaches at that point, and the graceful dispatcher close is no longer awaited. Timeout and error paths stay destructive and bounded, and the timeout keeps bounding time-to-headers only. Closes apache#2126
Benjamin-eecs
force-pushed
the
fix/2126-streaming-proxied-fetch
branch
from
August 4, 2026 14:04
a6c18f7 to
608eac5
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.
Summary
proxiedFetch used to await dispatcher.close(), and a graceful close waits for the active request. A streaming caller therefore did not receive the Response until body EOF.
What changed:
No shared proxy pool and no global proxy setting changes.
Closes #2126
Verification