Skip to content

fix(sdk-recorder): cancel and abort failed multipart uploads - #3384

Open
vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/sdk-multipart-failure-cleanup
Open

vedanth-jadhav wants to merge 1 commit into
CapSoftware:mainfrom
vedanth-jadhav:fix/sdk-multipart-failure-cleanup

Conversation

@vedanth-jadhav

@vedanth-jadhav vedanth-jadhav commented Oct 26, 2026 •

Copy link
Copy Markdown

The SDK aborts multipart uploads only for non-OK PUT responses. Presign/network failures leave their remote upload session open, concurrent parts continue after one fails, and an abort error can replace the actual part failure. A missing ETag can also reach completion as an empty receipt.

Give each upload's presign/PUT requests a shared cancellation signal. On a pre-completion failure, cancel siblings, drain their promises, and attempt one remote abort with its own ten-second deadline, then rethrow the original error. Reject missing ETags before completion, and clean up synchronous progress-callback failures too. Initiation failures have no known session to abort; completion failures remain outside this cleanup because the object may already have committed.

Validation on Linux x86_64 / Bun 1.4.4:

  • 47 SDK tests pass, including 12 new cases. Six of the initial nine checks fail against unchanged production code.
  • Covers presign/network/HTTP failures, absent ETags, failing and stalled abort requests, sibling presign/PUT cancellation, exact-once abort, callback errors, initiation/completion controls, and successful four-part/multi-batch bytes, ordered receipts and progress.
  • Cleanup-deadline behavior is driven by an explicit timer callback; no sleep or elapsed-time assertion is used.
  • Scoped strict TypeScript (noUncheckedIndexedAccess), Biome and diff checks pass.
  • Combined locally with independent fix(sdk-recorder): isolate uploads from restarted capture #3380: 55 tests, full package typecheck and ESM/declaration build pass. On main alone, the complete SDK declaration check still reports the pre-existing generic unsubscribe TS2345; fix(sdk-recorder): isolate uploads from restarted capture #3380 fixes that unrelated baseline typing error. This PR itself changes only the multipart client and its new test file.

Reproduce: cd packages/sdk-recorder && bun test. Network order and storage responses are controlled fixtures; live S3/browser capture were not run. Remote abort is best effort and can add up to ten seconds when its endpoint stalls. The original failure remains visible if cleanup fails. Successful part sizes, concurrency, receipt contents and progress values are preserved. No dependencies, public APIs or generated files change. This is error cleanup rather than throughput optimization; checked current main/open work for overlap.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge.

Summary

The SDK now cancels sibling multipart requests after a part fails, waits for them to settle, and attempts one remote abort without replacing the original error.

  • Failed multipart uploads cancel sibling requests and try remote cleanup.

Reviews (1) · Last reviewed commit: "fix(sdk-recorder): cancel and abort fail..." · Reviewed by Greptile

@vercel

vercel Bot commented Oct 26, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
cap-status Skipped Skipped Oct 26, 2026 12:28pm UTC

@vercel
vercel Bot temporarily deployed to Preview – cap-status October 26, 2026 12:28 Inactive

This branch was previously deployed

1 inactive deployment
Preview – cap-status — 27f39e05 Deployed Oct 26, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant