Skip to content

fix(s3): preserve retryable file uploads - #302

Closed
quidl wants to merge 1 commit into
dekobon:mainfrom
quidl:codex/upstream-s3-retry
Closed

quidl wants to merge 1 commit into
dekobon:mainfrom
quidl:codex/upstream-s3-retry

Conversation

@quidl

@quidl quidl commented Oct 30, 2026 •

Copy link
Copy Markdown

Summary

  • Preserve immutable small-file S3 PUT bytes across maintained AWS SDK retries. Stage once into a retained private temporary file and use the SDK's replayable path-backed body, rather than an already-open non-replayable stream or the caller's mutable path.
  • Map HTTP 429/500/502/503/504 service responses to the existing transient error category while retaining the original downcastable SDK response. Keep permanent mappings, multipart behavior, public interfaces and dependency versions unchanged.
  • Add meaningful retry/status regressions and an Unreleased changelog entry. No custom retry loop is introduced.

Related issues

Fixes #301

Test plan

  • On exact committed head 9af443b6f008ebc081bcbc869e43294ca4d4a214, Rust 1.96.0, locked/offline: full default workspace lib/bins/tests with test-util passes 1,258 tests (zero failures, one pre-existing ignored); workspace doctests pass seven (zero failures, one pre-existing ignored). The 61 S3 tests, including both new regressions, are included in the 1,258 count.
  • cargo build --workspace --all-targets, strict default and all-feature workspace/all-target Clippy, warnings-denied all-feature rustdoc, and formatting pass on that same clean head. Source and lockfile are identical before/after.
  • Retry regression consumes the first HTTP request, returns 503, mutates the caller's original file, then consumes an SDK retry with the same original bytes and returns 200. Status regression retains the actual typed SDK response/status/code.
  • make pre-commit on this contribution source — attempted, but local GNU Make 3.81 is rejected by the repository's GNU Make 4.x version guard before any recipe runs.
  • make ci — attempted, with the same prerequisite failure before any recipe runs.
  • Markdown lint — attempted; markdownlint-cli2 is unavailable locally.
  • Real S3/Azure emulator integration — not run for this contribution.

These direct Cargo checks supplement the unavailable Make gates; they do not replace the full contribution checks. Four Docker-gated test binaries executed zero tests, so compiling all features does not qualify runtime integration. No gate or assertion was disabled or waived.

Notes for reviewers

Draft for review; full upstream gates remain required. The mock uses checksumWhenRequired and locked AWS SDK 1.144.0. Other checksum modes, large multipart, real backend and all-platform qualification are not inferred. This addresses bounded SDK request replay, not recovery from exhausted accepted-write/lost-reply failures or process death. It includes no ref/GC change or production SDK adoption.

Stage bounded PUT payloads once and let the maintained SDK replay
immutable bytes. Preserve transient response categories and sources.
Add exact retry/status regressions and an Unreleased changelog entry.

Fixes dekobon#301
@quidl quidl closed this Nov 2, 2026
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.

S3 small-file PUT body cannot replay after a transient response

1 participant