Repository navigation
test(relay): load generator can send two concurrent assigns per host (--duplicate-assign-probes) - #27107
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Priority: ⬇️ Low Merge Risk: 🟡 Moderate · up to The duplicate-assignment probe can report a two-cell join after the primary has disconnected, potentially misleading staging validation. Resolve or explicitly accept this before merging. Pre-merge checks |
|
There was a problem hiding this comment.
Actionable comments posted: 1
🔇 Additional comments (1)
cloud/dev/scripts/relay-load-duplicate-assign.mjs-61-63 (1)
61-63: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
⚠️ Unverified finding
Verification ran but could not confirm this finding. It is shown for review, not as a verified issue.Start each twin's hold when that twin joins.
If one pair connects quickly and another pair takes longer, the first twin stays open for the slower pair's connection time plus
holdMs. With many probes, the configured hold duration does not bound a twin's occupancy. Start a per-twin hold timer after its successful connection, then shut down that twin when its timer expires.
ℹ️ Review info
⚙️ Run configuration
- Configuration used: Repository UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
cb723a6a-2b1f-4386-9bb1-7be04ed3cadc
📒 Files selected for processing (8)
cloud/dev/scripts/load-relay-controls.mjscloud/dev/scripts/relay-load-control-peer.mjscloud/dev/scripts/relay-load-control-peer.test.mjscloud/dev/scripts/relay-load-duplicate-assign.mjscloud/dev/scripts/relay-load-duplicate-assign.test.mjscloud/dev/scripts/relay-load-profile.mjscloud/dev/scripts/relay-load-profile.test.mjscloud/package.json
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 7 remain after this review.
| await twin.connect(second) | ||
| result.joinedBoth++ | ||
| twins.push(twin) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟠 Major | ⚡ Quick win
Confirm that both controls overlap before counting a join.
If the primary closes while twin.connect(second) runs, Line 54 still increments joinedBoth. The report then claims a two-cell join that did not occur. Check that the original primary control is still open when the twin joins, and record a failed overlap separately. A later director reconnect must not count as the original first-cell connection.
…(--duplicate-assign-probes) Rebased onto main as one commit; kept both sides of the package.json test-list conflict with #27096.
6128ceb to
3600673
Compare
ELI5
The staging load generator can now ask the relay "which cell?" twice at the same moment for one test desktop. That reproduces, on purpose, the rare case where two relay directors each pick a different cell for the same desktop. The staging step-5 run then checks the relay cleans it up.
What Changed
--duplicate-assign-probes N(with--duplicate-assign-hold-ms, default 20 s) oncloud/dev/scripts/load-relay-controls.mjs. It needs--director-origin./v1/assigncalls;duplicateAssign: probes, answers, splits, same-epoch splits, both-joined count, refusal and close codes, and the split hosts with their two answers (synthetic load hosts), so the operator can compare ledger rows afterwards.RelayLoadControlPeertakes an optionalkeys(for the twin) andconnect(assignment)(use this answer instead of asking the director).Before: the equal-epoch gate in the staging runbook could only be watched in a production canary. After: it can be driven on staging.
Why
Two directors mint the same epoch only when two assigns for one host reach two director instances within a poll. No existing probe does that, and Cloud Run cannot target an instance. Two parallel requests are the only way to get there.
When both land on the same instance, the second is refused by that instance's in-flight check. So a pair where both answers succeed and name different cells is direct evidence the case happened. That beats inferring it from logs.
Linked Issue
N/A (internal step-5 staging runbook, §6).
Visual Proof
N/A: a test-harness script change with no UI.
Testing
relay-load-duplicate-assign.test.mjs(same-epoch split, different-epoch split, refused second assign, refused twin); a profile bounds test; and a peer test that a twin shares the host id and connects with the given assignment without calling the director. That last test fails ifconnect(assignment)is ignored.node --testsuite fromcloud/package.jsonpasses locally: 756/756.Review
Agent skill upstream boundary
Notes
Only the load generator changes; nothing runs in production. The cross-platform impact is nil, since this is a Node script run on Linux runners.
Checklist
N/Afor visuals, with reasonpnpm lint,pnpm typecheck,pnpm test, andpnpm build(CI will cover;cloud/is outside root lint and format)