Repository navigation
feat(relay): slower same-cap drain paces (15 and 20 min) for every cell class - #26350
Conversation
…cell class c28's 1,901-host drain at the 300 s pace (~6.3 hosts/s, 2026-10-07) held database lock time over its bar for about 10 minutes. Add 15- and 20-minute pace windows to the same-cap closed set, allowed on every cell class. - The cell's /v1/admin/drain cap rises from 5 to 20 minutes. - The drain script fails instead of falling back to an unpaced drain when a cell rejects a window above 300000, since an older image answers both with the same 400. - The fast-pace US-only rule and the canary PASS rule apply only below the default; a canary still authorizes its own pace or slower. - The restart-safe timeout adds the window's excess over 300000 (quiet starts after the last host leaves), unchanged at 300000/60000/30000; the job timeout rises from 90 to 120 minutes.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (7)
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 5 remain after this review. 📝 WalkthroughWalkthroughThe same-cap drain workflow now supports pacing windows up to 1,200,000 ms. The changes update window validation, canary pacing rules, and behavior when a cell rejects a paced drain request. Workflow timeouts and tests now account for longer windows. The documentation describes the available windows, cell restrictions, canary rules, and rejection handling. Priority: ➖ Normal Merge Risk: ⚪ Minimal · up to The slower drain windows have no confirmed merge-blocking issue in the reviewed change. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 7 files. (2 skipped: 2 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
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 |
…not accept it The cell advertises its drain pace cap on /health; the same-cap job reads it before the isolate, so a pace above an old image's 300000 cap stops with the cell untouched instead of isolated. Also refreshes two stale timeout comments and pins the drain step under its one-hour ID token and the job's 70-min remainder.
ELI5
When we upgrade a relay server, we first ask every desktop connected to it to move to another server. We spread those requests over a time window, five minutes today. On a busy Asia server five minutes was too fast: the database got overloaded. This PR adds slower options, 15 and 20 minutes, so a busy server can be emptied gently.
What Changed
900000(15 min) and1200000(20 min), alongside300000,60000and30000. The slow ones are allowed on every cell, Asia included. The faster-than-default ones are still US general cells only.Expected per-cell drain time (drain plus quiet wait): about 30 minutes at
900000and about 40 at1200000, against about 10 at300000. For a ~2,000-host Asia cell that is about 2.2 hosts/s at 15 min and 1.7 hosts/s at 20 min, against about 6.3 at 5 min.Why
On 2026-10-07, c28 (Asia, 1,901 hosts) drained at the 5-minute pace, about 6.3 hosts/s. It held database lock time over its bar for about 10 minutes and caused director errors. US cells drain about 650 hosts at about 2.2 hosts/s without trouble, so the fix is to bring big Asia cells down to that rate.
Alternatives considered:
Caveat: a slower window works only on a cell already running an image with this change. That means a cell's next roll after this merges. The cell now reports its pace cap on
/health(drainPaceWindowMaxMs; images without it are treated as 300000). The job reads that cap before isolating the cell and stops with the cell untouched if the requested window is higher. Re-dispatch at300000.This is evidence code. Merge it between cells, never during a wave. Merging voids any sealed canary authority or monitor, so the next wave needs a fresh canary.
Linked Issue
N/A (internal relay operations).
Visual Proof
N/A: rollout workflow and relay server change, no UI.
Testing
node --testover every cloud script test incloud/package.json(pretest + test lists): 928/928 pass.vitestonregional-host-drain-app.test.tsandhost-session-registry.test.ts: 92/92 pass.tsc --noEmitpasses forapps/relay.actionlinton both workflows: only the existing unknownblacksmithrunner-label notices./healthread, and runs before the isolate step;Notes
No desktop, mobile, SSH or cross-platform impact. Old values behave exactly as before.
Checklist
N/Avisual proof with reason