Skip to content

[wrangler] help with silent success during large asset uploads - #15621

Open
petebacondarwin wants to merge 2 commits into
mainfrom
fix/asset-upload-silent-success
Open

[wrangler] help with silent success during large asset uploads#15621
petebacondarwin wants to merge 2 commits into
mainfrom
fix/asset-upload-silent-success

Conversation

@petebacondarwin

@petebacondarwin petebacondarwin commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

Partially addresses #15060.

The asset uploader awaits every queued bucket and requires a completion JWT, so it cannot normally report success with a partial upload count. The reported false-success logs are missing Wrangler's final ✨ Success! Uploaded ... message, which means the CLI stopped before syncAssets() completed.

This PR fixes two client-side contributors to that failure:

  • The Wrangler executable translated a signal-killed CLI child (code === null) into exit code 0. It now returns the conventional nonzero 128 + signal status, preventing OpenNext and Workers Builds from treating a killed deploy as successful.
  • API request logging eagerly converted every multipart body to a string before checking the log level or sanitization setting. With three concurrent asset buckets this made full, discarded copies of up to roughly 150 MiB of request data. Multipart bodies are now materialized only for explicitly enabled, unsanitized debug logs.

In an isolated 3 x 48 MiB multipart benchmark, the old logging path added about 400 MiB of peak RSS over direct Undici. After this change the same path peaked at 881 MiB versus an 843 MiB direct-Undici control and performed no discarded body conversions. A live 240 MiB upload also confirmed that the queue refilled promptly while active network requests took about 60 seconds each.

This deliberately does not add a fixed per-request timeout. The prior two-minute proposal in #15235 could abort healthy large uploads on slower connections, and the live measurements show that a principled timeout needs separate design. The issue should remain open while the intermittent long-running AUS request path is verified, but this change removes the concrete memory amplifier and makes signal termination fail truthfully.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: This fixes internal request logging and process exit behavior without changing the documented interface.

Note

This is a contribution from an AI agent: Codex (GPT-5).


Devin Review

@changeset-bot

changeset-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 27c1ef0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 10 packages
Name Type
wrangler Patch
@cloudflare/workers-utils Patch
@cloudflare/vite-plugin Patch
@cloudflare/vitest-plugin Patch
@cloudflare/autoconfig Patch
@cloudflare/cli-shared-helpers Patch
@cloudflare/containers-shared Patch
@cloudflare/deploy-helpers Patch
@cloudflare/remote-bindings Patch
@cloudflare/workers-auth Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk Sep 12, 2026
@workers-devprod
workers-devprod requested review from a team and jamesopstad and removed request for a team September 12, 2026 11:33
@workers-devprod

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/quiet-assets-succeed.md: [@cloudflare/wrangler]
  • .changeset/soft-assets-listen.md: [@cloudflare/wrangler]
  • packages/workers-utils/src/cfetch/index.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/cfetch-utils.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/bin/wrangler.js: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/bin/wrangler.test.ts: [@cloudflare/wrangler]

@ask-bonk

ask-bonk Bot commented Sep 12, 2026

Copy link
Copy Markdown
Contributor

LGTM

github run

devin-ai-integration[bot]

This comment was marked as resolved.

@pkg-pr-new

pkg-pr-new Bot commented Sep 12, 2026

Copy link
Copy Markdown
@cloudflare/autoconfig

npm i https://pkg.pr.new/@cloudflare/autoconfig@15621

@cloudflare/build-output-utils

npm i https://pkg.pr.new/@cloudflare/build-output-utils@15621

@cloudflare/codemods

npm i https://pkg.pr.new/@cloudflare/codemods@15621

@cloudflare/config

npm i https://pkg.pr.new/@cloudflare/config@15621

@cloudflare/containers-shared

npm i https://pkg.pr.new/@cloudflare/containers-shared@15621

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@15621

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@15621

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@15621

miniflare

npm i https://pkg.pr.new/miniflare@15621

@cloudflare/pages-functions

npm i https://pkg.pr.new/@cloudflare/pages-functions@15621

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@15621

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@15621

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@15621

@cloudflare/vitest-plugin

npm i https://pkg.pr.new/@cloudflare/vitest-plugin@15621

@cloudflare/workers-auth

npm i https://pkg.pr.new/@cloudflare/workers-auth@15621

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@15621

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@15621

wrangler

npm i https://pkg.pr.new/wrangler@15621

commit: 27c1ef0

@petebacondarwin petebacondarwin changed the title [wrangler] prevent silent success during large asset uploads [wrangler] help with silent success during large asset uploads Sep 12, 2026
@petebacondarwin petebacondarwin linked an issue Sep 12, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

Worker asset upload sometimes silently fails

2 participants