Repository navigation
🐛 fix(soft): ignore a restore claim with an invalid pid - #871
Merged
Merged
Conversation
The new test spelled the planted claim's name inline while its siblings build it with _restore_name, so the two spellings could drift apart. Widen the helper to take the pid as text and use it here too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A peer that can write to a lock's directory could plant a file named like a stale-recovery claim,
<lock>.restore.<pid>.<token>, beside a dead holder'sSoftFileLock,MarkerSoftFileLockorSoftFileLeasemarker. The recovery step added in #843 read that pid with a\d+match and probed it unchecked. An oversized number madeacquire()raiseOverflowErrorout ofos.kill;0probed the caller's whole process group, read as alive, and kept the dead holder's lock from ever being reclaimed; and a contender adopted a fullwidth spelling of its own pid as its own claim and exchanged that file's content onto the lock path.The recovery scan now accepts only ASCII digits and ignores a claim whose pid falls outside
1..2**31-1, the range every other holder parser in the package already enforces. No filelock writes such a claim, so the scan loses nothing legitimate and moves on to the stranded markers it came for.