filelock 4.2.6__tar.gz → 4.2.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {filelock-4.2.6 → filelock-4.2.7}/PKG-INFO +1 -1
- {filelock-4.2.6 → filelock-4.2.7}/docs/changelog.rst +17 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_lease.py +4 -5
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/version.py +2 -2
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_lease.py +1 -0
- {filelock-4.2.6 → filelock-4.2.7}/.gitignore +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/LICENSE +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/_static/custom.css +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/api.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/concepts.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/conf.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/example.gif +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/how-to.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/index.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/license.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/logo.svg +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/docs/tutorials.rst +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/pyproject.toml +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/__init__.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_api.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_async.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_async_read_write.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_descriptor.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_error.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_identity.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_marker.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_read_write.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_protocol.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/__init__.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_async.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_protocol.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_storage.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_sync.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_strict.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_unix.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_util.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_windows.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/asyncio.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/src/filelock/py.typed +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/benchmark.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/capabilities.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/capability/assert_fallback.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/capability/sitecustomize.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/coverage_pragmas.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/deny_symlink.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/termux/Dockerfile +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tasks/verify_filesystem.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/async_filelock_cancellation_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/capability_marks.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/conftest.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/descriptor_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/fork_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/pid_namespace_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/process_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/read_write_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/conftest.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_async.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_protocol.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_storage.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_sync.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_acquire_cancellation.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_release_cancellation.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_rollback_agnostic.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_runner_shutdown.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_transition_admission.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_cancel_wait.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_cancellation.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_worker_ownership.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_soft_contracts.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_transition_gate.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_default_mode.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_descriptor_helpers.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_error.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_filelock.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_backends.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_coordination.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_ownership.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_registries.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_host_name_grammar.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_lazy_import.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_lifetime_validation.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_lock_expiry.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_marker_records.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_process_identity.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_fork.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_private_link.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_unit.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_lifetime_warning.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_stale.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_compat.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_failures.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_paths.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_races.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_recovery.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_stress.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_subclass_options.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_unix_fallback.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_util.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tests/test_virtualenv.py +0 -0
- {filelock-4.2.6 → filelock-4.2.7}/tox.toml +0 -0
|
@@ -6,6 +6,23 @@
|
|
|
6
6
|
|
|
7
7
|
.. towncrier release notes start
|
|
8
8
|
|
|
9
|
+
.. _release-4-2-7:
|
|
10
|
+
|
|
11
|
+
********************
|
|
12
|
+
4.2.7 (2026-11-02)
|
|
13
|
+
********************
|
|
14
|
+
|
|
15
|
+
.. _release-4-2-7-fixed:
|
|
16
|
+
|
|
17
|
+
Fixed
|
|
18
|
+
=====
|
|
19
|
+
|
|
20
|
+
- A :class:`~filelock.SoftFileLease` reclaims a dead holder's lease marker even when that holder published another
|
|
21
|
+
``lease_duration``. It used to raise :class:`~filelock.LeaseSettingsMismatch` on every attempt instead, so after a
|
|
22
|
+
holder crashed and its peers restarted with a changed duration the lock stayed wedged until :meth:`force_break()
|
|
23
|
+
<filelock.MarkerSoftFileLock.force_break>`. A live holder with another duration still raises (:pr:`900`) by
|
|
24
|
+
:user:`dxbjavid` and :user:`gaborbernat`.
|
|
25
|
+
|
|
9
26
|
.. _release-4-2-6:
|
|
10
27
|
|
|
11
28
|
********************
|
|
@@ -261,6 +261,10 @@ class SoftFileLease(MarkerSoftFileLock):
|
|
|
261
261
|
owner, marker = peer
|
|
262
262
|
if pinned not in {None, marker.st_ino}: # pragma: win32 no cover # Windows pins nothing
|
|
263
263
|
return # replaced before the read, so nothing keeps the number read from reuse
|
|
264
|
+
# Duration governs age-based expiry; a dead owner has no lease left to disagree with.
|
|
265
|
+
if owner.mode != "unknown" and owner_is_stale(owner.pid, owner.hostname, owner.start):
|
|
266
|
+
self._take_over(marker, owner.pid)
|
|
267
|
+
return
|
|
264
268
|
# Only a peer that published a lease agreed to be superseded by age; an exclusive owner is reclaimed only once
|
|
265
269
|
# it is provably dead, and a contract this version does not know never is. Raise the mismatch outside the read
|
|
266
270
|
# so the suppression cannot swallow it.
|
|
@@ -270,11 +274,6 @@ class SoftFileLease(MarkerSoftFileLock):
|
|
|
270
274
|
f"{self._lease_duration!r}s; every contender for a path must agree on lease_duration"
|
|
271
275
|
)
|
|
272
276
|
raise LeaseSettingsMismatch(msg)
|
|
273
|
-
# A dead or recycled owner is reclaimed at once, whether it held a lease or an exclusive marker; a live lease
|
|
274
|
-
# owner whose marker stops being refreshed is superseded on the schedule every contender agreed to.
|
|
275
|
-
if owner.mode != "unknown" and owner_is_stale(owner.pid, owner.hostname, owner.start):
|
|
276
|
-
self._take_over(marker, owner.pid)
|
|
277
|
-
return
|
|
278
277
|
if owner.mode == "lease" and self._marker_unchanged_for(marker) >= self._lease_duration:
|
|
279
278
|
self._take_over(marker, None)
|
|
280
279
|
|
|
@@ -18,7 +18,7 @@ version_tuple: tuple[int | str, ...]
|
|
|
18
18
|
commit_id: str | None
|
|
19
19
|
__commit_id__: str | None
|
|
20
20
|
|
|
21
|
-
__version__ = version = '4.2.
|
|
22
|
-
__version_tuple__ = version_tuple = (4, 2,
|
|
21
|
+
__version__ = version = '4.2.7'
|
|
22
|
+
__version_tuple__ = version_tuple = (4, 2, 7)
|
|
23
23
|
|
|
24
24
|
__commit_id__ = commit_id = None
|
|
@@ -226,6 +226,7 @@ def test_lease_self_heals_a_malformed_marker(marker: Path, mocker: MockerFixture
|
|
|
226
226
|
"contract",
|
|
227
227
|
[
|
|
228
228
|
pytest.param(f"mode=lease\ntoken=abc\nduration={_DURATION!r}\n", id="lease"),
|
|
229
|
+
pytest.param(f"mode=lease\ntoken=abc\nduration={_DURATION * 3!r}\n", id="lease-other-duration"),
|
|
229
230
|
pytest.param("mode=exclusive\n", id="exclusive"),
|
|
230
231
|
],
|
|
231
232
|
)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|