Skip to content

Release completed preflight admission locks before sampling - #87

Closed
jsflax wants to merge 2 commits into
fix/interactive-busy-write-budgetfrom
fix/admission-preflight-lock-release
Closed

jsflax wants to merge 2 commits into
fix/interactive-busy-write-budgetfrom
fix/admission-preflight-lock-release

Conversation

@jsflax

@jsflax jsflax commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Successful admission preflight previously closed its descriptor before resource sampling. A retained duplicate could keep that lock held, so final admission returned concurrency instead of reaching the configured resource verdict.

This draft is stacked on #86. It explicitly unlocks only a successfully prepared preflight lease before closing it and sampling; an unlock failure refuses admission. The final worker lease remains close-only, so its retained descriptor continues to block another admission for its lifetime.

The first commit adds a deterministic regression with product code unchanged. The existing clock callback runs under the preflight lock; the fixture matches the unique lock descriptor by device/inode among currently open descriptors and retains a close-on-exec duplicate. It expects the resource-unavailable verdict with no launch or timestamp. A separate control pins the final worker lease until its duplicate closes. No fork, sleep, arbitrary descriptor number or product injection seam is used.

Linux at test-only 54532659f, attempt 1, compiled and failed exactly the preflight control with three issues: one clock read instead of two, no final pressure read, and concurrency instead of resource-unavailable. The final-worker control and the other 99 declarations passed. The test file is byte-identical in the fix commit.

All original checks finished at e4a585656761d31bba91c88a0e8bcb76de3c7367:

Check Result
Linux 101 declarations / 109 expanded cases / 23 suites passed; no issues or runtime skips. Both new controls and both retry-budget cases pass.
Native Compiles; broad selection has 799 passing declarations / 893 expanded executed cases, 14 framework skips and no issues. Both new controls and the resource-policy assertion that failed previously pass. All later serial checks and all seven MCP cases pass. The unchanged busy-response gate measures 4.262 s < 6 s, with rejected-write absence, recovery, two reopens and three clean exits.
Visualizer macOS app/unit-target build and all 152 selected unit tests pass.

Native's broad summary counts 813 declarations in 82 suites, including its 14 skips. Four benchmark declarations counted as passes returned early because fixture inputs were absent. The six serial invocations pass 10, 1, 1, 1, 1 and 1 declarations; these are separate invocations, not additional unique tests. Source, lockfile, SDK mirror and all 43 dependency checkout pins are unchanged in the native receipt. Warm-multistore's optional read-visibility check remains unverified. Visualizer does not qualify an iOS build.

Scope: post-flock refusals inside preparation (invalid clock/policy, cooldown and state-read errors) retain their existing close-only cleanup. This does not claim complete preflight-exit coverage. The previous failure did not identify its unexpected holder; the deterministic control proves this descriptor-lifetime defect, not that historical attribution.

Syntax and whitespace checks pass. No workflow, resource policy, timeout threshold or final-worker lease behavior changed. No manual rerun was performed.

jsflax and others added 2 commits November 15, 2026 13:12
Retain a duplicate through successful preflight preparation to expose a
lock surviving into resource sampling and final admission. Keep a separate
control for the final worker lease until its retained duplicate closes.

Co-Authored-By: Codex <noreply@openai.com>
Explicitly release the successful preflight lock before closing its file
descriptor, so retained references cannot block final admission. Refuse
admission if unlocking fails. Preserve the worker lease lifetime.

Co-Authored-By: Codex <noreply@openai.com>
@jsflax

jsflax commented Nov 17, 2026

Copy link
Copy Markdown
Owner Author

Consolidated in #88 (explicit LOCK_UN release on completed preflight admission leases before resource sampling).

@jsflax jsflax closed this Nov 17, 2026
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