Repository navigation
Releases
Releases Β· tox-dev/filelock
4.2.12
Immutable
release. Only release title and notes can be modified.
Bug fixes
UnixFileLockrefuses, withPermissionError, a lock file that another account owns under a sticky parent such as/tmp. Its owner could remove it during a hold, after which a second process locked a new file at the same path and both held the lock. A file owned by the directory's owner, such asrootin/tmp, is still accepted (#968) by @gaborbernat.
4.2.11
Immutable
release. Only release title and notes can be modified.
Bug fixes
AsyncStrictSoftFileLockwith apoll_intervalbelow 0.05 seconds now spreads contended retries across a jittered, widening window likeStrictSoftFileLock, instead of a fixed interval (#928) by @feiiiiii5 and @gaborbernat.SoftReadWriteLockon runtimes withoutdir_fdother than Windows, such as GraalPy, now refuses a protocol directory another account owns under a sticky parent, as the other platforms already do (#940) by @gaborbernat.- A
SoftFileLeasegarbage collected on its own heartbeat thread no longer deadlocks that thread, which left every lateros.fork()in the process waiting forever (#949) by @gaborbernat. - A lock dropped during interpreter shutdown, including a
ReadWriteLockorAsyncReadWriteLock, no longer prints an ignored exception at exit (#933) by @kushaldave002 and @gaborbernat. - A lock still referenced when the interpreter exits is released from an
atexithandler before module teardown, except holds of daemon threads that are still running, and athread_local=Falselock while any other thread runs (#964) by @gaborbernat. - On Windows, lock paths that differ only in drive letter or UNC share case, such as
C:\work.lockandc:\work.lock, now share oneFileLockorSoftReadWriteLocksingleton and triggerFileLock's same-thread deadlock detection (#929) by @subotac and @gaborbernat. - Releasing a soft lock whose marker a peer replaced no longer raises
AttributeErroron GraalPy, which lacksos.pwrite(#940) by @gaborbernat. os.fork()no longer waits forever for a lock transition another thread never finishes; after 30 seconds the child exits with status 70 and the parent continues (#949) by @gaborbernat.
New Contributors
- @kushaldave002 made their first contribution in #933
- @subotac made their first contribution in #929
- @hector2394 made their first contribution in #935
4.2.10
Immutable
release. Only release title and notes can be modified.
Bug fixes
- Contended
FileLockandSoftFileLockacquisitions now raiseTimeoutwhen elapsed time reaches the requested timeout. A clock that landed exactly on the deadline previously left a waiter retrying with zero-length sleeps indefinitely (#922) by @gaborbernat.
Packaging
- Every wheel now carries a PEP 770 CycloneDX SBOM in its
.dist-info/sbomsdirectory, written at build time by python-sbom (#921) by @gaborbernat.
4.2.9
Immutable
release. Only release title and notes can be modified.
Bug fixes
ReadWriteLock,SoftReadWriteLockand their async wrappers now raiseTypeErrorfor a blocking that is not abool, in the constructor and on acquire, asFileLockalready does. Before,blocking=0waited out the full timeout on a contendedReadWriteLockwhileblocking=Falsefailed at once, and a truthy value such as"false"turned a single attempt into a blocking wait (#908) by @abhishekcpp007 and @gaborbernat.
New Contributors
- @abhishekcpp007 made their first contribution in #908
4.2.8
Immutable
release. Only release title and notes can be modified.
4.2.7
Immutable
release. Only release title and notes can be modified.
Bug fixes
- A
SoftFileLeasereclaims a dead holder's lease marker even when that holder published anotherlease_duration. It used to raiseLeaseSettingsMismatchon every attempt instead, so after a holder crashed and its peers restarted with a changed duration the lock stayed wedged untilforce_break(). A live holder with another duration still raises (#900) by @dxbjavid and @gaborbernat.
4.2.6
Immutable
release. Only release title and notes can be modified.
Bug fixes
- Fix a race in
SoftFileLock,MarkerSoftFileLockandSoftFileLeasewhen three or more contenders reclaim a dead marker. The race could strand a live holder's marker under a break name, leaving the lock unusable or admitting a second holder. Contenders now recheck the marker before exchanging names and unwind nested exchanges in order. If the filesystem refuses a return exchange, the contender leaves its marker at the lock path for later recovery (#899) by @dxbjavid and @gaborbernat.
4.2.5
Immutable
release. Only release title and notes can be modified.
Bug fixes
acquireandacquireraiseTypeErrorfor a blocking that is not abool, as the constructor and theblockingsetter already do. A truthy value such as the string"false"used to count asTrue, so a call meant as a single attempt waited for the instance'stimeout, and without a limit at the default-1(#870) by @simpleqt and @gaborbernat.- A
SoftFileLockacquisition whose first read of its new marker's identity failed reads it again before rolling back. On Windows the rollback could otherwise not recognize the marker it had created, and the empty marker it left blocked the path for every later acquisition, since no contender breaks an empty marker (#869) by @simpleqt and @gaborbernat. - A
fork()child of a process holding aSoftFileLeasestarts from an unheld claim. It used to inherit the parent's token, last compromise and heartbeat, sotokenandcompromisereported a claim the child never held whileis_lockedreported it unheld (#868) by @dxbjavid and @gaborbernat. - A nested acquire of a held
FileLockorSoftFileLockno longer creates the lock file's parent directory. After a rename of that directory during the hold, the nested acquire recreated the old name, and when a file had taken the name it raisedFileExistsErrorand left the hold's recursion count incremented (#878) by @0x5t4l1n and @gaborbernat. - Fix
ReadWriteLockfailing every acquire with "link directory ... was replaced while opening" in a group-writable directory whose inherited ACL, such as an NFSv4 one on ZFS, opens the link directory to the group. The lock now closes the empty link directory to its owner, and where the filesystem refuses that, such as ZFS withaclmode=restricted, it names the directory to make writable by its owner only (#898) by @gaborbernat. - Fix
SoftFileLock,MarkerSoftFileLockandSoftFileLeaseraisingOverflowErrorout ofacquire(), or never reclaiming a dead holder's lock, when a stranded restore claim beside the lock names a process number outside1..2**31-1or spells it in non-ASCII digits. Such a claim is now ignored, as no filelock writes one (#871) by @dxbjavid and @gaborbernat. - Fix soft locks on Windows keeping the marker of a holder that has exited while another process still holds a handle to it, such as a parent's
subprocess.Popenafterwait()ormultiprocessing.Processafterjoin(). Acquiring such a lock with the defaulttimeout=-1waited forever (#874) by @nk-batman21. - Fix the read-only reopen of a lock file this account cannot write resolving a relative path against the working directory of the moment. A
chdirbetween the refusedO_RDWRopen and the reopen made the acquisition wait on a file that is not there, or probe one in another directory. The reopen now uses the path the acquisition pinned (#889) by @dxbjavid and @gaborbernat. - Handle
EMLINK, the error FreeBSD reports when a no-follow open refuses a symlink, in a soft reader/writer lock's protocol tree, so heartbeat reports lost ownership there rather than a transient refresh error (#866) by @pacocartones and @gaborbernat. - Resolving
ReadWriteLockorAsyncReadWriteLockraises theImportErrorwhen a module other than Python'ssqlite3is missing, as in a frozen application that left out a filelock submodule. The names areNoneonly without SQLite (#880) by @pintu544 and @gaborbernat.
Documentation
- The lock-probing recipe in the how-to guide probes with
blocking=Falseinstead of a tinytimeout(#873) by @tongwentao and @gaborbernat.
Packaging
- Releases now run on the shared tox-dev/github-workflows pipeline, with a locked release toolchain and generated GitHub Release notes (#885) by @gaborbernat.
New Contributors
- @simpleqt made their first contribution in #869
- @KennyMcSimpson made their first contribution in #875
- @0x5t4l1n made their first contribution in #878
- @tongwentao made their first contribution in #873
- @pacocartones made their first contribution in #866
- @nk-batman21 made their first contribution in #874
- @pintu544 made their first contribution in #880
- @00200200 made their first contribution in #877
4.2.4
Immutable
release. Only release title and notes can be modified.
4.2.3
Immutable
release. Only release title and notes can be modified.
Bug fixes
- Creating a lock on a Python 3.15 interpreter without
types.LazyImportTypeno longer triggersAttributeErrorat exit. #861 by @gaborbernat. - Handle
EFTYPEwhen a no-follow open refuses a symlink in a soft reader/writer lock's protocol tree, so heartbeat reports lost ownership rather than a transient refresh error. #859 by @edsonsims.
New Contributors
- @edsonsims made their first contribution in #859