Repository navigation
Say that acquire raises on a malformed lease - #146
Merged
Merged
Conversation
The docstring listed malformed leases as acquirable, but _read_lease raises MalformedLeaseError before steal is consulted, as the README's claim contract says. The test now covers steal=True too.
Deicyde
marked this pull request as ready for review
October 6, 2026 01:02
This was referenced Oct 6, 2026
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.
ClaimBoard.acquire's docstring listed malformed leases as acquirable._read_leaseraisesMalformedLeaseErrorbeforestealis consulted, which matches the README's claim contract. This PR fixes the docstring and extends the malformed-lease test tosteal=True.This restores 5e102ca from closed #115. The split into #135 left it out, and #135 has since merged into main.
Tests:
ruff checkis clean.tests/test_claims.py: 99 passed, 1 failed. The failure istest_cas_acquire_race_has_exactly_one_winner: its thread outlived the 10 s join under a local load average above 300. It passes when run alone, and this change touches only a docstring.