Skip to content

Say that acquire raises on a malformed lease - #146

Merged
Deicyde merged 1 commit into
mainfrom
fix/acquire-malformed-docstring
Oct 6, 2026
Merged

Deicyde merged 1 commit into
mainfrom
fix/acquire-malformed-docstring

Conversation

@Deicyde

@Deicyde Deicyde commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

ClaimBoard.acquire's docstring listed malformed leases as acquirable. _read_lease raises MalformedLeaseError before steal is consulted, which matches the README's claim contract. This PR fixes the docstring and extends the malformed-lease test to steal=True.

This restores 5e102ca from closed #115. The split into #135 left it out, and #135 has since merged into main.

Tests: ruff check is clean.

tests/test_claims.py: 99 passed, 1 failed. The failure is test_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.

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.
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Oct 5, 2026
@Deicyde
Deicyde marked this pull request as ready for review October 6, 2026 01:02
@Deicyde
Deicyde merged commit 4cf7f9e into main Oct 6, 2026
9 checks passed
@Deicyde
Deicyde deleted the fix/acquire-malformed-docstring branch October 6, 2026 01:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant