Skip to content

🐛 fix(unix): reopen a denied lock at the pinned path - #889

Merged
gaborbernat merged 2 commits into
tox-dev:mainfrom
dxbjavid:unix-denied-reopen-path
Oct 28, 2026
Merged

gaborbernat merged 2 commits into
tox-dev:mainfrom
dxbjavid:unix-denied-reopen-path

Conversation

@dxbjavid

@dxbjavid dxbjavid commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

A FileLock on a relative path whose lock file another account owns, so this process can only read it, could wait until its timeout instead of raising PermissionError, or probe an unrelated file, when another thread changed the working directory during the acquisition. 🧭 The read-only reopen that #835 added to tell a missing flock from a denied write resolved the caller's relative spelling of the path against the working directory of the moment, while #841 pins a canonical path for every other open in the acquisition.

The Unix backend now reopens through the same pinned path as its create and open attempts, so one acquisition names one file from start to finish. With the default timeout=-1 the old behaviour was an unbounded wait, and a flock-less filesystem under the new working directory could swap the instance to SoftFileLock while the pinned file sat on one that has flock.

dxbjavid and others added 2 commits October 27, 2026 21:21
The coverage pragma sits on the def line as in the module's other multi-line
tests, the captured os.open is Final as the sibling's lstat is, and the comment
keeps only the why. The fragment names the bug before the fix, as the other
Fixed entries do.
@gaborbernat gaborbernat changed the title fix(unix): reopen a denied lock file at the pinned path 🐛 fix(unix): reopen a denied lock at the pinned path Oct 28, 2026
@gaborbernat gaborbernat reopened this Oct 28, 2026
@gaborbernat
gaborbernat merged commit 3a3bf14 into tox-dev:main Oct 28, 2026
73 of 102 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants