Repository navigation
fix(fetch): ~110s retry budget, honour Retry-After, retry 429/408, report attempts (#1463) - #1597
Conversation
|
Navigate logical layers of code changes, visualize relationships, and explore their blast radius. No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository: FastLED/fbuild/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe downloader now retries HTTP 5xx, 429, and 408 responses using scheduled backoffs of 5, 15, 30, and 60 seconds. It parses delta-seconds ChangesPackage downloader retries
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~20 minutes Change: Bug fix Sequence Diagram(s)sequenceDiagram
participant get_with_retry
participant HTTP_endpoint
participant DownloadAttemptError
get_with_retry->>HTTP_endpoint: Send package request
HTTP_endpoint-->>get_with_retry: Return HTTP status and Retry-After header
get_with_retry->>DownloadAttemptError: Classify status and parse retry delay
DownloadAttemptError-->>get_with_retry: Return retryability and optional delay
get_with_retry->>get_with_retry: Select the larger scheduled or capped server delay
get_with_retry->>HTTP_endpoint: Retry package request
Merge Risk: ⚪ Minimal · up to The downloader intentionally waits longer for transient failures and reports attempts and elapsed time. No actionable merge-blocking risk remains after normal checks. Security Architecture ReviewSecurity architecture risk: 🔵 Low · up to Server responses can prolong package installation and delay other installations of the same package. Finite retry limits and request timeouts contain this exposure, while staged publication and checksum verification, when configured, remain in place. No new privilege or verification bypass was established. Retained concerns
Security review detailsSecurity Blast Radius
Security Findings and Attack Paths
Trust Boundaries and Controls
Resilience and Maintainability Implications
Hardening Proposals
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Partially addresses #1463 (does not close it; see the list at the bottom).
In
downloader.rs:teknic.comfailure).Retry-Afterhonoured (delta-seconds form) on retryable statuses: the wait is the larger of our schedule and the server's ask, capped at 120 s.… (after 5 attempts over 112.3s)/(after 1 attempt over 0.1s), so CI output can tell "retried 5×" from "never retried". (Streaming downloads already reported attempts and byte offset.)Tests (real local TCP fault-injection server, millisecond timings): 429→408→200 succeeds;
Retry-After: 1delays the retry by ≥1 s; error text carries attempt count and elapsed time for both exhaustion and fail-fast 404;Retry-Afterparsing; status classification; the policy test pins the new schedule (≥90 s, ≤300 s, one wait per retry). Existing retry/streaming tests unchanged and green: fetch/library/toolchain/build-engine lib suites 480/297/175/155 pass, clippy-D warningsclean.Trade-off worth a look: a fetch from a genuinely dead host now fails after ~110 s instead of ~15 s.
Not done (still open on the issue): env-configurable attempts/wait (
FBUILD_DOWNLOAD_MAX_ATTEMPTS/MAX_WAIT), jitter, mirror/fallback URLs and the primary-down-then-mirror test, a client-side line per retry (retries are still logged only in the daemon), and routing every fetcher (registry/metadata JSON) through this one helper. Resume-on-retry and a content-addressed cache short-circuit already existed.Summary by CodeRabbit