Skip to content

s3: S3File.writer().end(error) aborts the upload instead of committing - #33681

Open
robobun wants to merge 9 commits into
mainfrom
farm/b1f3dbf2/s3-writer-end-error-aborts
Open

s3: S3File.writer().end(error) aborts the upload instead of committing#33681
robobun wants to merge 9 commits into
mainfrom
farm/b1f3dbf2/s3-writer-end-error-aborts

Address review: root returned promise via EnsureStillAlive; drop stri…

ab9cb3b
Select commit
Loading
Failed to load commit list.
Claude / Claude Code Review completed Jul 7, 2026 in 26m 21s

Code review found 1 important issue

Found 1 candidates, confirmed 2. See review comments for details.

Details

Severity Count
🔴 Important 1
🟡 Nit 1
🟣 Pre-existing 0
Severity File:Line Issue
🟡 Nit src/runtime/webcore/streams.rs:2450-2458 end(error) orphans multipart upload when init request is in flight

Annotations

Check warning on line 2458 in src/runtime/webcore/streams.rs

See this annotation in the file changed.

@claude claude / Claude Code Review

end(error) orphans multipart upload when init request is in flight

When `end(error)` is called while `InitiateMultipartUpload` is still in flight (`state == MultipartStarted`), `fail()` takes the `deref_` branch instead of `rollback_multi_part_request()`, and `start_multi_part_request_result` later early-returns on `state == Finished` without reading the server-assigned `UploadId` — so no `AbortMultipartUpload` is ever sent and the upload is orphaned on S3. This is exactly the PR description's own repro (`write; write; end(err)` with no `await` between them); t