Skip to content

Locks: report shared lock-table exhaustion as ENOLCK#929

Closed
brandonpayton wants to merge 1 commit into
mainfrom
fix/shared-lock-table-enolck
Closed

Locks: report shared lock-table exhaustion as ENOLCK#929
brandonpayton wants to merge 1 commit into
mainfrom
fix/shared-lock-table-enolck

Conversation

@brandonpayton

Copy link
Copy Markdown
Member

Closes one focused slice from #769.

What #907 already landed

#907 fixed the mmap/munmap accounting and syscall-channel behavior that was mixed into the old composite branch. This PR does not replay any of that work.

What remains here

The shared host advisory-lock table has a fixed capacity. A conflicting lock and a full table used to look identical, so F_SETLKW could retry forever when no slot existed.

This change keeps the existing capacity and carries a detailed result through the host import:

  • a real conflict returns EAGAIN;
  • table exhaustion returns ENOLCK;
  • the direct blocking helper also stops on exhaustion instead of waiting;
  • focused tests and the POSIX status page record the boundary.

What I removed

The old #769 commit only raised the default table from 256 entries to 4096. That moved the failure point without defining correct behavior, so that capacity bump is deliberately not included.

ABI and package artifacts

The structural ABI 39 snapshot is unchanged. This corrects the errno for an existing host-side failure case and does not change syscall numbers, layouts, pointers, or generated bindings, so there is no ABI bump. No package recipe or package output changed, so no package rebuild is required.

Validation

Run through scripts/dev-shell.sh:

  • full repository build;
  • host typecheck;
  • 50 focused lock, cross-process, host-import, and multi-worker tests;
  • ABI snapshot/version check.

A full Vitest run reached 143 passing files and 1,239 passing tests, but four unrelated package/runtime fixture files failed locally while native Rust dependencies invoked the host archive tool; one earlier run also lacked the root tsx install. The focused final-state rerun is green and CI is running the full maintained matrix.

Not run locally: browser suites, libc/POSIX/Sortix conformance, or performance benchmarks. This PR makes no performance claim.

@brandonpayton

Copy link
Copy Markdown
Member Author

Closing this focused source PR because its shared lock-table exhaustion policy is now carried by #934 at exact green head 260d75d5adc31b327f5591229dbfbb287d395fd6. #934 keeps it as a separate purpose commit and passed the full staging gates. This is not a claim that this branch was merged verbatim.

@brandonpayton brandonpayton deleted the fix/shared-lock-table-enolck branch July 14, 2026 02:43
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