Skip to content

fix(polymarket): retry deferred uploader activation - #524

Merged
proerror77 merged 1 commit into
mainfrom
codex/polymarket-deferred-uploader-pid-race-523
Jul 30, 2026
Merged

proerror77 merged 1 commit into
mainfrom
codex/polymarket-deferred-uploader-pid-race-523

Conversation

@proerror77

@proerror77 proerror77 commented Jul 30, 2026

Copy link
Copy Markdown
Owner

Change contract

Within the existing 10-second deferred market-uploader admission loop, retry
while a new active/activating systemd invocation has not yet exposed a positive
MainPID or readable /proc/PID/exe. Preserve exact-binary, failed-unit, and
timeout fail-closed behavior.

Issue relationship

Refs #523

Out of scope

Collector/uploader data semantics, historical spool cleanup, Gate duration,
Python health cadence, research, snapshot/#235, evaluator/MCTS, CI
restructuring, and production mutation.

Dependency or merge order

None. This is based on exact main
8dc486906f1e2fcf4e940a6e9400c8433e61158c and is independently reversible.

Focused validation

  • RED: control-plane test rejected pid-delayed before the implementation.
  • GREEN: bash deployment/aliyun/test-polymarket-raw-ops-control-plane.sh.
  • bash -n on both changed scripts.
  • ShellCheck on both changed scripts.
  • git diff --check.
  • Focused code review: wrong executable, failed service, stale invocation, and
    10-second timeout remain fail-closed.

Rollout / rollback impact

After merge, build an exact-main artifact and repeat the real closed-segment
preflight. Reuse the already-passed 900-second Gate only if its immutable
candidate/source/control/bundle identities still match the new artifact;
otherwise run a fresh Gate. Production cutover remains governed by the existing
checksum-protected Python rollback snapshot and stop rules.

Why no PRD

This is a small, fully specified production activation race with a focused
failing proof; a PRD would add no product decision.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@coderabbitai

coderabbitai Bot commented Jul 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@proerror77, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 49 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 67105bc3-f032-4714-ab25-d74f02edd5af

📥 Commits

Reviewing files that changed from the base of the PR and between ea768fe and 1f47112.

📒 Files selected for processing (2)
  • deployment/aliyun/polymarket-raw-ops-cutover.sh
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
📝 Walkthrough

Walkthrough

Deferred market upload verification now retries transient MainPID and executable-resolution failures. The control-plane test harness simulates delayed visibility for both states and verifies that each eventually succeeds.

Changes

Deferred upload retry behavior

Layer / File(s) Summary
Retry transient process visibility
deployment/aliyun/polymarket-raw-ops-cutover.sh
Invalid MainPID values and unresolved executable paths now sleep and retry before the expected binary is checked.
Exercise delayed PID and executable states
deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
Mocks persist delayed-state markers and verifies that delayed PID and executable scenarios succeed.

Estimated code review effort: 3 (Moderate) | ~15–30 minutes

Possibly related issues

Possibly related PRs

  • proerror77/monday#518 — Modifies the same verification and control-plane test flow for delayed PID and executable resolution.
  • proerror77/monday#34 — Introduced the related raw-ops cutover verification and control-plane test code.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise and accurately summarizes the main change: retrying deferred uploader activation.
Description check ✅ Passed The description covers the required change contract, issue link, validation, rollout, and out-of-scope details with concrete specifics.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Fix failing CI checks
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/polymarket-deferred-uploader-pid-race-523

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proerror77
proerror77 enabled auto-merge (squash) July 30, 2026 21:02

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 `@deployment/aliyun/test-polymarket-raw-ops-control-plane.sh`:
- Around line 4359-4366: Update the pid-delayed mock’s readlink handling in the
`--property=MainPID` and corresponding `4380-4387` branches so an exact
`/proc/0/exe` request returns a non-matching path before the generic readlink
response. Add or adjust the targeted test to verify PID 0 validation is rejected
while preserving existing delayed-PID behavior.
🪄 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: 818e90f8-2e07-4dd2-a41a-6477a9184320

📥 Commits

Reviewing files that changed from the base of the PR and between 8dc4869 and ea768fe.

📒 Files selected for processing (2)
  • deployment/aliyun/polymarket-raw-ops-cutover.sh
  • deployment/aliyun/test-polymarket-raw-ops-control-plane.sh

Comment thread deployment/aliyun/test-polymarket-raw-ops-control-plane.sh
@proerror77
proerror77 force-pushed the codex/polymarket-deferred-uploader-pid-race-523 branch from ea768fe to 1f47112 Compare July 30, 2026 21:11
@proerror77
proerror77 merged commit d51453d into main Jul 30, 2026
41 checks passed
@proerror77
proerror77 deleted the codex/polymarket-deferred-uploader-pid-race-523 branch July 30, 2026 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant