Repository navigation
feat(547): recovery-class reserved slot and idle reclamation (slices 3–4) - #651
Merged
Merged
Conversation
Slice 3 — recovery-class reserved slot: when the pool has no vacant slot and
the daemon is ControlReady, admit one connection into the reserved slot and,
after decoding, allow only the recovery operation set (close = Unmount,
workspace status = Status, backend.daemon.connection_failures); any other
request is refused Capacity and the connection is closed. At most one
connection holds the reserved slot, and it closes after one request
(invariant 4). backend.daemon.reclaim joins the set in slice 5.
Slice 4 — idle reclamation: track each admitted slot's phase (Busy /
Idle { since }) at request boundaries, and under admission pressure reap pool
slots parked in receive() past idle_ttl by closing their socket fence. Nothing
is in flight, so nothing is lost; the woken worker finishes with a stale
ticket and the client pool quarantines the closed connection. Reserved slots
are never reaped.
Adds idle_ttl_ms to the daemon's private limits (wire format), the pure
recovery_request predicate, and unit + integration coverage (tests 8 and 11).
Do not implement slice 5 (in-flight expiry / backend.daemon.reclaim) or
slice 6 (typed reasons).
mengmengmengqiang
changed the base branch from
fix/547-slice-12
to
layerfs_v2_0_0
November 12, 2026 03:20
This was referenced Nov 12, 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.
Summary
Slices 3–4 of #547, stacked on
fix/547-slice-12. When the control pool is full a recovery-class client can now still get in, and idle pool slots are reaped instead of being lost to a parked worker.12 files, +643 −29, one commit on top of the slice 1–2 branch.
What this does
Slice 3 — recovery-class reserved slot
ControlReady, one connection is admitted into the reserved slot, and after decode only the recovery operation set is allowed:close(Unmount), workspace status (Status) andbackend.daemon.connection_failures. Anything else is refusedCapacityand the connection is closed.Slice 4 — idle reclamation
Busy/Idle { since }).receive()pastidle_ttlare reaped by closing their socket fence. Nothing is in flight, so nothing is lost: the woken worker finishes with a stale ticket and the client pool quarantines the closed connection. Reserved slots are never reaped.idle_ttl_msjoins the daemon's private limits (wire format), with the purerecovery_requestpredicate.Slices 5 (in-flight expiry /
backend.daemon.reclaim) and 6 (typed reasons) are deliberately not here; they are the next PR in the stack.Test evidence
Dell
aluminium(x86_64, 88 cores),rustc 1.85.1:The 11 failures are not from this branch. I built and ran the same
-p layerfs-api -p layerfs-control -p layerfs-sandboxsuite on unmodifiede9b903eac: base fails 12 of those tests, and this branch's failing set is a strict subset of base's — zero new failures.They are a host limitation of the test machine, not of the code: the kernel-mount suites need
/dev/fuseowned by the test user and fail as a normal user withkernel attach Mount: Operation not permitted (os error 1)/FUSE device ownership/type. Run as root they pass, but the daemon refuses to start when the command uid equals the owner uid, sodaemon_slots/slot_stateneed a non-root user. The suite therefore cannot be green in one configuration on that host.Refs #547, #540 — not closing either.