Repository navigation
test(coderd/x/chatd): fail partitioned admissions that straddle the partition - #234
ibetitsmike wants to merge 2 commits into
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex review
|
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Superseded by #236. This PR edits Root cause, kept here for reference: |
Fixes #61
TestRunnerManager_HeartbeatDoesNotReviveStaleLeasefailed intermittently in fork-cichat-testswithtimed out waiting for task call kind="generation"for chat B at line 296.Cause
The fake partition let replica one admit B. The failing run's cleanup log (run 43171336736 attempt 1) shows that replica one's worker owned generation tasks for both A and B, so replica two never got B.
partitionableLimiter.Admitread thepartitionedflag before the real admission counted capacity. An acquisition pass on replica one, woken by the message queued on A, could pass that check just before the test set the flag. If it then counted capacity aftermakeHeartbeatStalemade A's lease stale, it found the slot free and admitted B. Replica two then saw B with a fresh lease and A refused, and waited for a B generation that never came.Fix
partitionableLimiter.Admitchecks the flag again after the inner admission and fails the candidate if the partition began meanwhile. The error rolls back the acquisition transaction, so a partitioned replica admits nothing. The test sets the flag before it makes the lease stale, so any count that sees the stale lease also sees the flag. Only the test changes; production admission is not involved.This edits a test file synced from upstream (
7dee434315), so a later upstream sync that changespartitionableLimitermay conflict.Validation
In Colima (postgres:17),
-run TestRunnerManager_HeartbeatDoesNotReviveStaleLease$:-count=5timed out waiting for task call kind="generation", the CI symptom-count=5-count=50-count=50-race -count=10TestAdmission_,TestRunnerManager_,TestRenewChatHeartbeatsThe sleep exists only in the validation overlay; it is not committed.