Repository navigation
check hostname in is_lock_held_by_us - #553
Merged
Merged
Conversation
the lock file stores the holder's hostname so pid checks stay scoped to one host; on a shared filesystem two hosts can run the same pid, so matching the pid alone reported another host's lock as held by us. require the hostname to match too.
Contributor
Author
|
Thanks for the review and merge! Appreciated |
ozeranskii
pushed a commit
to tempusbuild/runner-images
that referenced
this pull request
Jun 10, 2026
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [filelock](https://redirect.github.com/tox-dev/py-filelock) | `==3.29.1` → `==3.29.2` |  |  | --- ### Release Notes <details> <summary>tox-dev/py-filelock (filelock)</summary> ### [`v3.29.2`](https://redirect.github.com/tox-dev/filelock/releases/tag/3.29.2) [Compare Source](https://redirect.github.com/tox-dev/py-filelock/compare/3.29.1...3.29.2) <!-- Release notes generated using configuration in .github/release.yaml at 3.29.2 --> #### What's Changed - open marker reads non-blocking to refuse attacker-placed fifo by [@​dxbjavid](https://redirect.github.com/dxbjavid) in [tox-dev/filelock#549](https://redirect.github.com/tox-dev/filelock/pull/549) - 🔒 fix(soft): harden stale-lock breaking and self-heal malformed locks by [@​gaborbernat](https://redirect.github.com/gaborbernat) in [tox-dev/filelock#551](https://redirect.github.com/tox-dev/filelock/pull/551) - check hostname in is\_lock\_held\_by\_us by [@​dxbjavid](https://redirect.github.com/dxbjavid) in [tox-dev/filelock#553](https://redirect.github.com/tox-dev/filelock/pull/553) **Full Changelog**: <tox-dev/filelock@3.29.1...3.29.2> </details> --- ### Configuration 📅 **Schedule**: (in timezone Etc/UTC) - Branch creation - "before 6am on monday" - Automerge - At any time (no schedule defined) 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/tempusbuild/runner-images). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yMDkuNCIsInVwZGF0ZWRJblZlciI6IjQzLjIwOS40IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiXX0=--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This was referenced Aug 26, 2026
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.
is_lock_held_by_us compares only the pid from the lock file against os.getpid() and ignores the hostname stored alongside it, so on a shared filesystem where the same pid is live on two hosts a lock genuinely held by another node is reported as held by us, and a caller acting on that by releasing or breaking it can drop a lock another host still holds. the lock file already records the hostname for exactly this disambiguation and the stale-break path checks it, so this reads the holder through _parse_lock_holder and requires both the pid and the hostname to match before returning true. added a regression case to the existing is_lock_held_by_us parametrisation covering a same-pid, different-host file.