Repository navigation
🐛 fix(soft): keep marker creation tied to its file - #1049
Merged
gaborbernat merged 1 commit intoNov 21, 2026
Merged
Conversation
gaborbernat
marked this pull request as draft
November 20, 2026 15:32
gaborbernat
changed the base branch from
main
to
fix/soft-release-identity-jvg
November 20, 2026 15:47
gaborbernat
force-pushed
the
fix/soft-interrupted-create-04b
branch
from
November 20, 2026 15:47
d9dd041 to
d7723d5
Compare
gaborbernat
added a commit
to gaborbernat/filelock
that referenced
this pull request
Nov 20, 2026
Base Windows strict claims on the private-record policy from tox-dev#1045 and the marker API from tox-dev#1049.
gaborbernat
force-pushed
the
fix/soft-interrupted-create-04b
branch
from
November 20, 2026 15:57
d7723d5 to
066ffc7
Compare
gaborbernat
marked this pull request as ready for review
November 20, 2026 17:36
gaborbernat
marked this pull request as draft
November 20, 2026 19:33
gaborbernat
marked this pull request as ready for review
November 20, 2026 21:45
gaborbernat
marked this pull request as draft
November 20, 2026 22:00
gaborbernat
changed the base branch from
fix/soft-release-identity-jvg
to
main
November 20, 2026 23:58
Capture the descriptor while creating the marker so an interrupted acquire can close it and identify its file. On Windows, create the marker without following a final symlink. If descriptor conversion fails, request deletion through a handle to the marker this call created. Fixes tox-dev#996 Fixes tox-dev#1009
gaborbernat
force-pushed
the
fix/soft-interrupted-create-04b
branch
from
November 21, 2026 00:00
5205cc4 to
3b17f00
Compare
gaborbernat
marked this pull request as ready for review
November 21, 2026 00:22
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.
An interrupted soft lock acquisition could leave an empty marker that blocked the next caller. An existing Windows symlink could also direct the holder record to a different file. Both problems affected
SoftFileLock,MarkerSoftFileLock, andSoftFileLease.The acquiring process records the descriptor as it creates the marker, including the private replacement it prepares when taking over a stale lock. If acquisition raises before it returns, cleanup can identify the file it created. On Windows, exclusive native creation treats an existing symlink as an occupied name and leaves its target untouched.
A Windows marker remains readable while held. If descriptor conversion fails, cleanup writes a newline and requests deletion through a handle to that marker. If a reader temporarily denies deletion, a later caller can reclaim the malformed marker. An uncatchable exit or a filesystem that refuses both the write and deletion can still leave an empty marker.
flowchart TD Start["Create marker"] --> Exists{"Name occupied?"} Exists -->|Yes| Wait["Handle contention"] Exists -->|No| FD["Record descriptor"] FD --> Ready{"Record written?"} Ready -->|Yes| Hold["Report acquired"] Ready -->|No| Clean["Close descriptor and clean up marker"] classDef path fill:#cfe4ff,stroke:#1f6feb,color:#0b1f3a classDef outcome fill:#cbe8d3,stroke:#287544,color:#102519 class Start,Exists,FD,Ready path class Wait,Hold,Clean outcomeSupersedes #1055.
Fixes #996. Fixes #1009.
Reported by OSS Scanner (ANT-2026-04B5BJXO and ANT-2026-75X3BYMX).