Repository navigation
fix(cli): Upload chunks over HTTP/1.1 to stop HTTP/2 stream resets - #2210
Merged
Merged
Conversation
The standalone binaries run Node 26, whose fetch (undici 8) uses HTTP/2 by default. Parallel chunk-upload requests then share one connection as HTTP/2 streams, and Sentry's edge resets all but one concurrent upload stream with ENHANCE_YOUR_CALM. Each retry hits the same reset, so large uploads (debug files with many new chunks) failed with a bare "TypeError: fetch failed". Chunk uploads now use a scoped HTTP/1.1 dispatcher, one connection per concurrent request, as the legacy sentry-cli (curl without HTTP/2) did. The dispatcher is built from the runtime's own global dispatcher class, so no undici dependency is added and NODE_USE_ENV_PROXY still applies; runtimes whose fetch defaults to HTTP/1.1 are unchanged. A chunk upload that gets no response now throws an ApiError that names the network cause instead of the bare TypeError. Co-Authored-By: BYK <[email protected]>
Add a `dispatcher` option to the authenticated fetch, next to `idempotent` and `timeoutMs`, so chunk uploads no longer wrap the fetch and cast its init. Type the dispatcher as fetch's own `dispatcher`. Mock the dispatcher module in the chunk upload tests instead of faking undici's global dispatcher, and trim repeated comments. Co-Authored-By: BYK <[email protected]>
Node 24 (undici 7) also registers undici.globalDispatcher.2, so the dispatcher is created there too; it just keeps HTTP/1.1. Note that Node registers the dispatcher on the first fetch. Refs getsentry#2201 Co-Authored-By: BYK <[email protected]>
…am per connection With maxConcurrentStreams: 1, undici 8 opens only 3 HTTP/2 connections for 8 parallel uploads and queues the rest; locally that was about 2.5x slower than HTTP/1.1 with one connection per upload. Refs getsentry#2201 Co-Authored-By: BYK <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
@sentry-junior[bot] is attempting to deploy a commit to the Sentry Team on Vercel. A member of the Team first needs to authorize it. |
BYK
approved these changes
Nov 12, 2026
BYK
enabled auto-merge (squash)
November 12, 2026 21:50
7 tasks done
BYK
pushed a commit
that referenced
this pull request
Nov 19, 2026
…esets (#2439) `sentry snapshots upload` fails with a bare `Unexpected error: TypeError: fetch failed` once a snapshot has three or more images over 1 MiB. Objectstore requests now go over HTTP/1.1, as chunk uploads already do since #2210, and a failed request shows its network cause. This is the same issue as #2201. Images over 1 MiB are PUT individually, 5 at a time, and on Node 26 they share one HTTP/2 connection, where Sentry's edge resets most streams with `ENHANCE_YOUR_CALM`. I checked this with `@sentry/api`'s `putObjects` and a logging fetch on 16 images of 6–8 MB: over HTTP/2, 3 of the first 5 PUTs were reset; over HTTP/1.1 with the same concurrency, all 16 uploaded in about 6 s. The objectstore client is unchanged up to `@sentry/api` 2.16.0, so the fix stays in the CLI adapter.
This branch was previously deployed
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
sentry debug-files uploadfrom the standalone binaries fails at random withUnexpected error: TypeError: fetch failed(#2201).The binaries use Node 26, whose
fetch(undici 8) uses HTTP/2 by default. The parallel chunk uploads (concurrency: 8, up to 32 MiB each) then share one HTTP/2 connection, and Sentry's edge resets all concurrent upload streams except the last one withENHANCE_YOUR_CALM. Retries hit the same reset, and the error reached the user without its cause.Changes
allowH2: false) with one connection per request, as legacysentry-clidoes.createHttp1Dispatcher()builds it from the runtime's own global dispatcher class, so no undici dependency is added andNODE_USE_ENV_PROXYstill applies.getSdkConfigtakes adispatcheroption, next toidempotentandtimeoutMs. Each upload creates its dispatcher and destroys it afterwards.ApiErrorthat names the network cause, not a bareTypeError.Testing
dispatcheroption, and the chunk-upload error path.fetch failed); after, 4/4 succeeded in about 10 s with no retries.Fixes #2201