Skip to content

🐛 fix(soft-rw): reject non-finite timing options - #724

Open
lprnmns wants to merge 1 commit into
tox-dev:mainfrom
lprnmns:codex/fix-soft-rw-finite-intervals
Open

🐛 fix(soft-rw): reject non-finite timing options#724
lprnmns wants to merge 1 commit into
tox-dev:mainfrom
lprnmns:codex/fix-soft-rw-finite-intervals

Conversation

@lprnmns

@lprnmns lprnmns commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

Problem

SoftReadWriteLock accepts NaN and Infinity for its timing options. Those values can turn heartbeat waits into a busy loop, prevent stale markers from expiring, or defer an invalid poll delay until sleep().

Change

Reject non-finite heartbeat_interval, stale_threshold, and poll_interval values alongside the existing range checks.

Validation

  • Regression test: 6/6 non-finite cases pass after failing before the fix
  • pytest -q tests/soft_rw — 104 passed
  • ruff check src tests/soft_rw
  • ruff format --check src tests/soft_rw
  • ty check tests/soft_rw/test_soft_rw_sync.py
  • git diff --check

No public API shape changes; valid timing values behave as before.

@lprnmns
lprnmns force-pushed the codex/fix-soft-rw-finite-intervals branch from 34e839c to d92050e Compare September 2, 2026 21:28
@lprnmns
lprnmns marked this pull request as ready for review September 3, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant