<#1136 fix: honor Retry-After on upload 429/503 + ...
# flyte-github
a
#1136 fix: honor Retry-After on upload 429/503 + raise default max backoff Pull request opened by EngHabu Summary S3 returns
status 429 SlowDown
when an object is mutated too fast. The SDK's
_upload_with_retry
(in
src/flyte/remote/_data.py
) gives up after 3 attempts with exponential backoff capped at 10s — not long enough to clear a SlowDown rate-limit window. Users see:
Copy code
RuntimeSystemError: Failed to upload ... after 3 retries: status 429: <Error><Code>SlowDown</Code>...
Changes 1. Honor
Retry-After
on 429/503 responses.
When the upstream sends
Retry-After: <seconds>
, the next retry sleeps for that many seconds (clamped to
retry_after_cap_sec
, default 60s). HTTP-date form falls back to exponential backoff. New
retry_after_cap_sec
parameter (default 60). 2. Default
max_backoff_sec
raised from 10s → 30s.
Gives the exponential path room to grow long enough to ride out a typical SlowDown window when no header is present. Still parameterized. Both knobs remain function parameters; existing callers are unchanged. Closes • FLYTE-SDK-4A —
Failed to upload ... after 3 retries: status 429 SlowDown
from
_upload_with_retry
.
fixes FLYTE-SDK-4A
Test plan • New: honors
Retry-After
integer-seconds. • New: clamps absurd
Retry-After
values to
retry_after_cap_sec
. • New: 429 without
Retry-After
still uses exponential backoff. • All 11 tests in
tests/flyte/remote/test_upload_retry.py
pass. •
make fmt
clean. 🤖 Generated with Claude Code flyteorg/flyte-sdk