Range-lock conflicts can strand waiters in stale queues A waiter that moves to a new…
- User
Range-lock conflicts can strand waiters in stale queues
A waiter that moves to a new range conflict must no longer remain in stale queues. Cleanup must preserve unrelated lock state, wake the next eligible waiter when necessary, and continue to work when the previous key disappeared or was recreated.
Interface
No new interfaces are introduced.
- Assistant
I’ll trace the range-lock waiter/queue lifecycle, identify the stale membership path, then patch it and run focused tests plus the relevant package suite.
- Assistant
rgisn’t installed in this workspace, so I’m using targetedfind/grepsearches instead. I’m also checking repository guidance before editing. - Assistant
The defect is in cleanup: it only handled a waiter if it was already the head of an unheld lock, so waiters behind holders—or elsewhere in the queue—were left stale. I’m changing cleanup to remove the exact waiter identity, and moving that cleanup before insertion into the new conflict queue; that ordering is important when the same key was deleted and recreated.
- Assistant
The focused tests are building now. I’m also adding regression coverage for the two queue invariants: removing a non-head stale waiter without disturbing holders/other waiters, and waking the next waiter when the stale waiter was the head of an unheld lock.
- Assistant
The focused regressions pass. The cleanup now uses pointer identity rather than transaction ID or key identity, so a recreated lock at the old key is left untouched unless it actually contains that waiter. I’m running the full lock-service package tests offline now.
- Assistant
The full package suite is still running without failures or output; this package includes longer concurrency tests. The focused queue and range-lock tests have already completed successfully.
- Assistant
The full package run failed after about two minutes, but its extremely verbose logs obscured the failing test in the captured output. I’m rerunning with output filtered to test failures only; the focused tests remain green.
- Assistant
The isolated failure exposed an intentional row-lock behavior: canceled row waiters remain recorded until holder release. My first helper change affected that path. I’m narrowing the new exact-removal behavior to range-conflict migration only, preserving existing row-lock semantics.
- Assistant
The narrowed implementation passes the range-lock set, waiter-queue tests, and the row-lock regression that caught the over-broad behavior. I’m doing one final isolated check of the other timing-sensitive test that failed during the noisy full-suite run.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.