Skip to content

fix: report a failed release of the state-root lock - #89

Merged
HaoZeke merged 2 commits into
developfrom
fix/lock-release-error
Nov 25, 2026
Merged

HaoZeke merged 2 commits into
developfrom
fix/lock-release-error

Conversation

@HaoZeke

@HaoZeke HaoZeke commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Closes #71.

RootLock.release now returns sys.Error!void, so a failed release of the state-root lock is reported instead of being ignored. A new test checks that a failed lock call comes back as an error.

This changes the public signature: the next zig-common pin bump needs follow-ups in eb-local and eb-staged-rebuild.

`RootLock.release` ignored a failed `fcntl(F_SETLK, F_UNLCK)` or
`flock(LOCK_UN)`, so the caller exited successfully. The Python
reference closes both descriptors and then lets the `OSError` out.
`release` returns `sys.Error!void` and does the same: both descriptors
are closed whatever either lock call returns, and the first error is
returned after the second close. `sys.last_errno` is restored to the
errno of that first error, so `sys.describe` names the call whose error
is returned.

The `rootlock` mode of the filesystem parity probe reports a failed
release in its status, and the API reference lists `sys.Error` for
`release`, the set its signature names.
The case uses `state.lock_ops` to make the `fcntl` release fail, the
`flock` release fail, and both fail at once, each with its own errno.
It then checks three things. `release` returns the record lock's
error first. Neither descriptor stays open. The state root can be
locked again. `sys.last_errno` and `sys.describe` must name the errno
of the returned error, `.IO` when both fail.
@HaoZeke
HaoZeke merged commit a45142a into develop Nov 25, 2026
8 checks passed
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