Skip to content

fix(relay): bound idle rehome polling and skip disabled scans - #20203

Merged
Jinwoo-H merged 2 commits into
mainfrom
relay-idle-polling-budget
Sep 12, 2026
Merged

Jinwoo-H merged 2 commits into
mainfrom
relay-idle-polling-budget

Conversation

@Jinwoo-H

@Jinwoo-H Jinwoo-H commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Setting the regional-correction cohort above zero started fleet/headroom/candidate scans on every director even while durable rehoming was disabled. During the production test, shared SQL CPU rose to 88–94%; cohort 0 was restored before enabling any migration, and CPU subsequently returned toward baseline.

Read the durable control before expensive selection and return for missing, disabled or future control. Space enabled polls by 6–7.2 seconds using the existing jitter, instead of 1–1.2 seconds. Transactional idle, capacity and enablement checks remain authoritative. This adds a few seconds of detection delay and reduces periodic scan frequency sixfold; it does not introduce a scheduler or cache.

Validation:

  • Disabled-control regression: red at five queries per tick, green at one; covers later enable/disable on the same store.
  • Cadence regression: red at six calls before six seconds, green at one; verifies timer cleanup.
  • Focused relay suite: 62 passed, one SQLite-only skip; PostgreSQL 16 store suite: 13 passed, no skips. Relay typecheck passed.
  • Updated the pre-existing sweep-jitter expectation to 6.6 seconds. Fresh Cloud Verify 34671652208 passed all jobs at e638d3d.
  • Full local PostgreSQL run: 687 passed/1 failed; legacy-lock recovery fixture also reproduces wrong_assignment without the new control gate. CI passes this suite; the local baseline discrepancy is recorded rather than hidden.
  • Local PostgreSQL benchmark: 30 cells, 10,000 synthetic hosts, six concurrent pollers and zero eligible moves. SQL rate 36→6 queries/sec with the cadence change; disabled gate costs one read per tick. Candidate query planning was ~104ms versus ~18ms execution. These are local measurements, not a production capacity guarantee.

Deploy to the director with cohort 0 first, then repeat monitored enablement. The two upgraded cells need no additional rollout for this director-only polling change. Production migration and phone reconnection remain unproven.

@pullfrog

pullfrog Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Pullfrog  | View workflow run | via Pullfrog | Using openrouter/deepseek/deepseek-v4.1-flash (free via Pullfrog for OSS) | 𝕏

@coderabbitai

coderabbitai Bot commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 8c43523e-7541-4ebc-a5d2-71e1e8df8237

📥 Commits

Reviewing files that changed from the base of the PR and between 865c930 and e638d3d.

📒 Files selected for processing (1)
  • cloud/apps/relay/src/relay-sweep-schedule.test.ts

📝 Walkthrough

Walkthrough

The regional rehome selector now returns no candidates when the global control is missing, disabled, or not yet effective. Tests cover control polling, activation, and disabling. The worker default polling interval changed from one second to six seconds. Tests verify immediate polling, six-second repetition, jitter, and shutdown behavior.

Merge Risk: ⚪ Minimal · up to 865c9

No actionable merge-blocking risk remains in the updated regional rehome control or polling behavior.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the problem, implementation, validation, performance impact, and rollout limits. It omits the required Linked Issue, Visual Proof or exact N/A statement, and several t… Add the required issue link, Visual Proof section with N/A and a reason if applicable, Testing checklist status, AI Disclosure status, Review, Agent skill upstream boundary, Notes, and final Checklist confirmations.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 4 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes both main changes: bounded idle rehome polling and skipping scans when durable control is disabled.
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.
Full details: Description check

Explanation

The description clearly explains the problem, implementation, validation, performance impact, and rollout limits. It omits the required Linked Issue, Visual Proof or exact N/A statement, and several template sections and checklist confirmations.

  • Fix all pre-merge checks with AI
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

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.

@Jinwoo-H
Jinwoo-H merged commit f7238ce into main Sep 12, 2026
24 checks passed
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