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 lifecycle and existing tests, then patch the queue transition and add focused regressions for disappeared/recreated keys.
- Assistant
rgisn’t installed here, so I’m switching to targetedfind/grepsearches and keeping the investigation local to the repository. - Assistant
The failure is in the transition itself: the code enqueues on the new conflict before trying to clean the old queue, and the old cleanup can notify the same waiter instead of removing it. I’m changing cleanup to remove the exact queue entry first and to distinguish the original queue from a lock recreated at the same key.
- Assistant
The focused regressions now pass, including stale-head handoff, a vanished prior key, and a same-key replacement whose holder/queue must remain untouched. I’m running the full lock-service suite next and checking queue/reference invariants.
- Assistant
The package suite is still running without failures or output; these tests are integration-heavy. The implementation diff is clean, and the targeted transition tests remain green.
- Assistant
The full suite found a failure, but its extremely verbose logs obscured the test name in the captured output. I’m rerunning with output filtered to failure records so I can determine whether it’s caused by this change or an existing flaky integration test.
- Assistant
The filtered rerun is still progressing and hasn’t emitted any failure record yet. While it runs, I confirmed the cleanup only deletes a lock when the stored lock still owns the exact remembered queue; a replacement at the same key is left intact.
- Assistant
The relevant full-suite failure exposed an intentional row-lock behavior: canceled row waiters remain queued until the holder releases. I’m isolating the new exact-removal behavior to range-conflict transitions so row-lock cancellation semantics stay unchanged. The other reported failure is an unrelated bind-change timeout.
- Assistant
Range/row/waiter tests now all pass, and the focused scenarios also pass under the race detector. I’m doing one final isolated check of the unrelated bind-change failure and then will hand off the completed patch.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.