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 and cleanup paths, then add focused regression coverage and run the relevant package tests.
- Assistant
The failure is in queue cleanup: it only conditionally “closes” a waiter and does not actually remove it when a holder remains; cancellation also skips cleanup for range requests. I’m tightening removal to target the exact waiter instance, which also protects a lock recreated at the same key.
- Assistant
The implementation now removes by waiter identity, so a replacement lock—even for the same transaction ID—cannot be mistaken for the stale queue. Focused tests cover holder preservation, handoff to the next waiter, missing keys, and same-key recreation; the package test is compiling now.
- Assistant
The first regression run exposed the recreated-same-key edge precisely: cleanup happened after enqueueing, so it could remove the waiter from the new lock. Cleanup now happens before the new enqueue; the focused concurrency regression passes, and I’m running the full lockservice suite.
- Assistant
The cancellation expectation has also been updated: canceled row waiters are now removed immediately instead of lingering with a residual queue reference. All targeted tests pass; the full package rerun is still in progress.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.