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.
Files changed (105) hide show
  1. {filelock-4.2.6 → filelock-4.2.7}/PKG-INFO +1 -1
  2. {filelock-4.2.6 → filelock-4.2.7}/docs/changelog.rst +17 -0
  3. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_lease.py +4 -5
  4. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/version.py +2 -2
  5. {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_lease.py +1 -0
  6. {filelock-4.2.6 → filelock-4.2.7}/.gitignore +0 -0
  7. {filelock-4.2.6 → filelock-4.2.7}/LICENSE +0 -0
  8. {filelock-4.2.6 → filelock-4.2.7}/docs/_static/custom.css +0 -0
  9. {filelock-4.2.6 → filelock-4.2.7}/docs/api.rst +0 -0
  10. {filelock-4.2.6 → filelock-4.2.7}/docs/concepts.rst +0 -0
  11. {filelock-4.2.6 → filelock-4.2.7}/docs/conf.py +0 -0
  12. {filelock-4.2.6 → filelock-4.2.7}/docs/example.gif +0 -0
  13. {filelock-4.2.6 → filelock-4.2.7}/docs/how-to.rst +0 -0
  14. {filelock-4.2.6 → filelock-4.2.7}/docs/index.rst +0 -0
  15. {filelock-4.2.6 → filelock-4.2.7}/docs/license.rst +0 -0
  16. {filelock-4.2.6 → filelock-4.2.7}/docs/logo.svg +0 -0
  17. {filelock-4.2.6 → filelock-4.2.7}/docs/tutorials.rst +0 -0
  18. {filelock-4.2.6 → filelock-4.2.7}/pyproject.toml +0 -0
  19. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/__init__.py +0 -0
  20. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_api.py +0 -0
  21. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_async.py +0 -0
  22. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_async_read_write.py +0 -0
  23. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_descriptor.py +0 -0
  24. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_error.py +0 -0
  25. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_identity.py +0 -0
  26. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_marker.py +0 -0
  27. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_read_write.py +0 -0
  28. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft.py +0 -0
  29. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_protocol.py +0 -0
  30. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/__init__.py +0 -0
  31. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_async.py +0 -0
  32. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_protocol.py +0 -0
  33. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_storage.py +0 -0
  34. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_soft_rw/_sync.py +0 -0
  35. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_strict.py +0 -0
  36. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_unix.py +0 -0
  37. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_util.py +0 -0
  38. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/_windows.py +0 -0
  39. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/asyncio.py +0 -0
  40. {filelock-4.2.6 → filelock-4.2.7}/src/filelock/py.typed +0 -0
  41. {filelock-4.2.6 → filelock-4.2.7}/tasks/benchmark.py +0 -0
  42. {filelock-4.2.6 → filelock-4.2.7}/tasks/capabilities.py +0 -0
  43. {filelock-4.2.6 → filelock-4.2.7}/tasks/capability/assert_fallback.py +0 -0
  44. {filelock-4.2.6 → filelock-4.2.7}/tasks/capability/sitecustomize.py +0 -0
  45. {filelock-4.2.6 → filelock-4.2.7}/tasks/coverage_pragmas.py +0 -0
  46. {filelock-4.2.6 → filelock-4.2.7}/tasks/deny_symlink.py +0 -0
  47. {filelock-4.2.6 → filelock-4.2.7}/tasks/termux/Dockerfile +0 -0
  48. {filelock-4.2.6 → filelock-4.2.7}/tasks/verify_filesystem.py +0 -0
  49. {filelock-4.2.6 → filelock-4.2.7}/tests/async_filelock_cancellation_helpers.py +0 -0
  50. {filelock-4.2.6 → filelock-4.2.7}/tests/capability_marks.py +0 -0
  51. {filelock-4.2.6 → filelock-4.2.7}/tests/conftest.py +0 -0
  52. {filelock-4.2.6 → filelock-4.2.7}/tests/descriptor_helpers.py +0 -0
  53. {filelock-4.2.6 → filelock-4.2.7}/tests/fork_helpers.py +0 -0
  54. {filelock-4.2.6 → filelock-4.2.7}/tests/pid_namespace_helpers.py +0 -0
  55. {filelock-4.2.6 → filelock-4.2.7}/tests/process_helpers.py +0 -0
  56. {filelock-4.2.6 → filelock-4.2.7}/tests/read_write_helpers.py +0 -0
  57. {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/conftest.py +0 -0
  58. {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_async.py +0 -0
  59. {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_protocol.py +0 -0
  60. {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_storage.py +0 -0
  61. {filelock-4.2.6 → filelock-4.2.7}/tests/soft_rw/test_soft_rw_sync.py +0 -0
  62. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock.py +0 -0
  63. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_acquire_cancellation.py +0 -0
  64. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_release_cancellation.py +0 -0
  65. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_rollback_agnostic.py +0 -0
  66. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_runner_shutdown.py +0 -0
  67. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_filelock_transition_admission.py +0 -0
  68. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write.py +0 -0
  69. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_cancel_wait.py +0 -0
  70. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_cancellation.py +0 -0
  71. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_read_write_worker_ownership.py +0 -0
  72. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_soft_contracts.py +0 -0
  73. {filelock-4.2.6 → filelock-4.2.7}/tests/test_async_transition_gate.py +0 -0
  74. {filelock-4.2.6 → filelock-4.2.7}/tests/test_default_mode.py +0 -0
  75. {filelock-4.2.6 → filelock-4.2.7}/tests/test_descriptor_helpers.py +0 -0
  76. {filelock-4.2.6 → filelock-4.2.7}/tests/test_error.py +0 -0
  77. {filelock-4.2.6 → filelock-4.2.7}/tests/test_filelock.py +0 -0
  78. {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_backends.py +0 -0
  79. {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_coordination.py +0 -0
  80. {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_ownership.py +0 -0
  81. {filelock-4.2.6 → filelock-4.2.7}/tests/test_fork_registries.py +0 -0
  82. {filelock-4.2.6 → filelock-4.2.7}/tests/test_host_name_grammar.py +0 -0
  83. {filelock-4.2.6 → filelock-4.2.7}/tests/test_lazy_import.py +0 -0
  84. {filelock-4.2.6 → filelock-4.2.7}/tests/test_lifetime_validation.py +0 -0
  85. {filelock-4.2.6 → filelock-4.2.7}/tests/test_lock_expiry.py +0 -0
  86. {filelock-4.2.6 → filelock-4.2.7}/tests/test_marker_records.py +0 -0
  87. {filelock-4.2.6 → filelock-4.2.7}/tests/test_process_identity.py +0 -0
  88. {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write.py +0 -0
  89. {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_fork.py +0 -0
  90. {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_private_link.py +0 -0
  91. {filelock-4.2.6 → filelock-4.2.7}/tests/test_read_write_unit.py +0 -0
  92. {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_lifetime_warning.py +0 -0
  93. {filelock-4.2.6 → filelock-4.2.7}/tests/test_soft_stale.py +0 -0
  94. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft.py +0 -0
  95. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_compat.py +0 -0
  96. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_failures.py +0 -0
  97. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_paths.py +0 -0
  98. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_races.py +0 -0
  99. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_recovery.py +0 -0
  100. {filelock-4.2.6 → filelock-4.2.7}/tests/test_strict_soft_stress.py +0 -0
  101. {filelock-4.2.6 → filelock-4.2.7}/tests/test_subclass_options.py +0 -0
  102. {filelock-4.2.6 → filelock-4.2.7}/tests/test_unix_fallback.py +0 -0
  103. {filelock-4.2.6 → filelock-4.2.7}/tests/test_util.py +0 -0
  104. {filelock-4.2.6 → filelock-4.2.7}/tests/test_virtualenv.py +0 -0
  105. {filelock-4.2.6 → filelock-4.2.7}/tox.toml +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: filelock
3
- Version: 4.2.6
3
+ Version: 4.2.7
4
4
  Import-Name: filelock
5
5
  Summary: A platform independent file lock.
6
6
  Project-URL: Changelog, https://py-filelock.readthedocs.io/en/latest/changelog.html
@@ -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.6'
22
- __version_tuple__ = version_tuple = (4, 2, 6)
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