fix(deploy): retry shadow-gate OSS readback on transient publication-race 404 - #557
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
|
Warning Review limit reached
Next review available in: 9 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 (2)
📝 WalkthroughWalkthroughThe shadow gate now retries OSS downloads up to 15 times with 12-second delays within the existing deadline. Data, manifest, and ChangesOSS download retry flow
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related issues
Possibly related PRs
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 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.
Actionable comments posted: 1
🧹 Nitpick comments (1)
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh (1)
3846-3851: 🎯 Functional Correctness | 🔵 Trivial | ⚡ Quick winTest the retry boundary instead of only matching source text.
These checks only prove that the gate contains one helper definition and three literal call strings. They do not prove that the data, manifest, and
_SUCCESSdownloads use the helper, or that retries stop at 15 attempts and at the deadline.If the extracted helper runs with the no-op
sleep()stub atdeployment/aliyun/test-polymarket-raw-ops-control-plane.sh:4677, the test cannot detect elapsed-time or post-deadline behavior. Add executable failure-then-success, attempt-exhaustion, and expired-deadline counterexample tests with controlled command stubs.As per coding guidelines, safety boundaries require a targeted counterexample test, not only workspace compilation.
🤖 Prompt for 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. In `@deployment/aliyun/test-polymarket-raw-ops-control-plane.sh` around lines 3846 - 3851, Replace the grep-only assertions around the OSS retry checks with executable counterexample tests for the extracted oss_download_with_retry helper: use controlled command stubs to verify data, manifest, and _SUCCESS downloads retry and eventually succeed, stop after 15 failed attempts, and do not execute after an expired deadline. Ensure the test setup overrides the no-op sleep and relevant download/time commands so attempt counts and deadline behavior are observable, while preserving the existing gate validation.Source: Coding guidelines
🤖 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 `@deployment/aliyun/polymarket-raw-ops-shadow-gate.sh`:
- Around line 694-695: Update the retry loop in run_before_deadline so the sleep
backoff is executed only while the deadline guard still permits it. Ensure a
failed run_before_deadline after expiration exits without sleeping or continuing
retries, while preserving the existing attempt limit and 12-second backoff
before the deadline.
---
Nitpick comments:
In `@deployment/aliyun/test-polymarket-raw-ops-control-plane.sh`:
- Around line 3846-3851: Replace the grep-only assertions around the OSS retry
checks with executable counterexample tests for the extracted
oss_download_with_retry helper: use controlled command stubs to verify data,
manifest, and _SUCCESS downloads retry and eventually succeed, stop after 15
failed attempts, and do not execute after an expired deadline. Ensure the test
setup overrides the no-op sleep and relevant download/time commands so attempt
counts and deadline behavior are observable, while preserving the existing gate
validation.
🪄 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: f08f5f61-25b4-4457-b01f-850bd7347708
📒 Files selected for processing (2)
deployment/aliyun/polymarket-raw-ops-shadow-gate.shdeployment/aliyun/test-polymarket-raw-ops-control-plane.sh
c2f0de4 to
9000532
Compare
The shadow uploader publishes data/manifest/_SUCCESS sequentially; a readback racing publication can observe a one-second 404 NoSuchKey (observed in production 2026-08-01T07:47:39+08, gate invocation 3736e02d). Retry each download up to 6 times with 10s backoff. Refs #556
Second production observation (2026-08-01T11:01:41+08): the object committed one second after the sixth retry, so 6x10s was still short. Retry 15x with 12s backoff (~3 min). Refs #556
9900b4b to
1bc0346
Compare
Change contract
Shadow-gate OSS triplet readback retries each download up to 6× with 10s backoff (deadline-bounded), so a one-second publication race (data object commits between the uploader's sequential writes) can no longer fail the whole gate.
Disclosure (evidence parity)
The on-host release copy of
polymarket-raw-ops-shadow-gate.sh(candidate cb55ac1d) is being patched with this exact file content to unblock the in-flight cutover; bundle hash recomputed. This PR makes it official.Out of scope
Dependency / merge order
None.
Focused validation
test-polymarket-raw-ops-control-plane.shPASS (new contract pins the retry wrapper on all three downloads)test-polymarket-raw-ops-stage.shPASS;bash -ncleanRollout / rollback impact
Takes effect with the next release bundle; host interim state matches. Rollback = revert.
Issue relationship
Refs #556
Summary by CodeRabbit
Bug Fixes
Tests