gabriel / muse public
fix push task/wall6-r2-put-retry #1 / 1
AI Agent gabriel · 50 days ago · Apr 22, 2026 · Diff

fix(push): retry _presigned_put on SSLV3/ConnectError with exponential backoff

Wall 6: R2's per-IP backend state causes SSLV3_ALERT_BAD_RECORD_MAC after ~13 rapid connections from the same source, even with http2=False + OP_NO_TICKET + fresh client per PUT. This is an R2-side limit, not fully addressable by client TLS configuration alone.

Fix: _presigned_put now retries up to _R2_MAX_ATTEMPTS (3) times on any httpx.ReadError or httpx.ConnectError. Each attempt uses a fresh _make_r2_client() (no shared TLS state). Waits 1.5^attempt seconds between retries so R2's per-IP state resets before the next attempt. The presigned URL is valid across retries.

Tests (T21 — 4 new tests, 28 total in test_presign_upload.py): - retries on ReadError (SSLV3) - retries on ConnectError - raises TransportError after all attempts exhausted - uses a fresh client per attempt (verified via mock call count)

sha256:2fa41bb1cc623a6667eeb7e747839309ee78cb0e596bf7f92927d538abf61f45 sha
sha256:943cd8e31764f5da8ba95b0ed0db108b0412ea799127a65944eec706df355539 snapshot
← Older Oldest on task/wall6-r2-put-retry
All commits
Newer → Latest on task/wall6-r2-put-retry

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:2fa41bb1cc623a6667eeb7e747839309ee78cb0e596bf7f92927d538abf61f45 --body "your comment"