fix(collector): widen uploader OSS readback retry window - #565
Conversation
|
Warning Review limit reached
Next review available in: 17 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughOSS readback now retries with bounded attempts and delays. Each artifact download uses a capped timeout. The retry loop also enforces a total wall-clock limit. ChangesOSS readback control
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 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 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7c64f011c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
c7c64f0 to
fb3a5d9
Compare
452a7ac to
88c96ae
Compare
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@rust_hft/tools/collector/src/polymarket_upload.rs`:
- Line 1886: Update download_remote_artifacts_with and its retry loop so every
runner invocation and retry delay is capped by the remaining
OSS_READBACK_MAX_WALL_CLOCK deadline; pass the deadline into the function, stop
immediately when no duration remains, and preserve existing retry behavior
otherwise. Add a deterministic regression test covering exhaustion during
sequential downloads or retry delay.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 19d767ac-25fa-4a86-b0d8-a71f0c49df43
📒 Files selected for processing (1)
rust_hft/tools/collector/src/polymarket_upload.rs
339b76f to
ea684bd
Compare
Production evidence (2026-08-01, gate invocations 3736e02d, 842bab38, 6d1bfe7f): a just-PUT object 404s for a few seconds past the 3x1s window before becoming HEAD-able, so the uploader's own readback fails and every shadow gate dies on 'combined gate evidence'. Widen to 12 attempts x 5s (~60s). Refs #556
Second-round review: the 120s backoff cap was dead code (11 x 5s sleeps = 55s maximum), and each download inherited the 300s upload timeout (36 downloads => hours worst case). Now: per-file readback timeout capped at 60s and the whole retry loop bounded by a 300s wall-clock budget. Refs #556
80c7f1c to
74eb889
Compare
Change contract
Uploader readback-after-upload: 12 attempts × 5s backoff, per-file timeout capped at 60s, and a 300s wall-clock budget for the whole loop (replacing the 3×1s window). This is the actual root cause of the repeated shadow-gate failures on 2026-08-01: the gate-script retry patch (#556) could not help because the 404 happens inside the uploader binary's own post-PUT verification.
Production evidence
Three gate invocations (3736e02d, 842bab38, 6d1bfe7f) failed on
ossutil cp404 NoSuchKey of just-uploaded shadow objects; in each case the object became HEAD-able moments after the 3×1s window expired (verified viaossutil statafterwards). With the wider window the readback succeeds instead of failing the upload (and thus the gate).Second-round review fixes
Out of scope
Dependency / merge order
None. Release note: candidate cb55ac1d carries the old 3×1s window and cannot pass the readback in this environment — the next release built after this merge must be gated instead.
Focused validation
cargo test -p hft-collector --lib polymarket_upload --locked: 62 passed, 0 failed, 0.69sRollout / rollback impact
Retry timing only; fail-closed semantics unchanged (upload still fails if the object never appears). Rollback = revert.
Issue relationship
Refs #556
Summary by CodeRabbit