Repository navigation
test(547): restore the daemon slot regression suite and structure slot custody (slices 1–2) - #650
Merged
Merged
Conversation
…sh the state machine (#547) Slice 1: restore the four deleted daemon assertions (the pre-#543 connection tests) as package integration tests, and make the pure Slots/RetainedFailures state machine public behind the #[doc(hidden)] internals module so it is unit-testable from tests/. No behavior change. - engine/crates/layerfs-daemon/tests/daemon_slots.rs: the four real-daemon custody assertions over TCP (undecodable records free their slot, the capacity notice on a full pool, and a concurrent failure storm). - engine/crates/layerfs-daemon/tests/slot_state.rs: the deleted owner/retained unit assertions plus the guard-drop release, via the public state machine. - application/internals.rs: #[doc(hidden)] re-export of the pub'd state-machine values; application/{owner,retained}.rs: Slots/RetainedFailures and their methods are now pub.
#547) Slice 2 (no behavior change): move RetainedFailures out of Slots into State, extract the pure disposition() classifier and capacity_report() read model, pass SlotClass instead of the reserved slot index to control_operation/hello, and delete the dead AdmissionClass::Lease, AdmissionReason::ReservedBusy and the three CAPACITY_OPERATION aliases (the bridge canonical OPERATION now stands alone). - owner.rs: Slots keeps only the slot table; State gains the retained store. A free disposition(&ConnectionFailure, SlotTicket, &str, Instant) -> Disposition builds the bounded record outside the lock; Slots::finish applies it. - connection.rs: SlotGuard records the retained record into state.retained; capacity_report(SlotCounts, RetainedSnapshot) -> CapacityModel is extracted; control_operation/hello take SlotClass; the CONNECTION_FAILURES alias is gone. - bridge/control/sandbox/control: AdmissionReason::ReservedBusy and the CAPACITY_OPERATION aliases are deleted; callers use OPERATION. - tests/slot_state.rs updated to the split Slots + RetainedFailures API.
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 1–2 of #547, rebased onto
layerfs_v2_0_0(e9b903eac, #543 merged). Slice 1 restores the daemon-slot regression suite that #543 deleted; slice 2 puts the slot-custody state machine into the shape the recovery work needs, with no behavior change.17 files, +862 −147. Two commits, authorship kept.
What this does
Slice 1 — restore the regression suite (test-only) —
4a0c3bd01engine/crates/layerfs-daemon/tests/daemon_slots.rs: the four real-daemon custody assertions over TCP — an undecodable record frees its slot, a full pool writes the capacity notice, and a concurrent failure storm neither deadlocks nor leaks.engine/crates/layerfs-daemon/tests/slot_state.rs: the deleted owner/retained unit assertions plus the guard-drop release, driven through the published state machine.Slots/RetainedFailuresand their methods are nowpub, re-exported behind a#[doc(hidden)]application::internalsmodule sotests/can exercise them.Slice 2 — structure, no behavior change —
50243b9c4RetainedFailuresmoves out ofSlotsintoState;Slotskeeps only the slot table.disposition()classifier and thecapacity_report()read model are extracted.disposition(&ConnectionFailure, SlotTicket, &str, Instant)builds the bounded record outside the lock andSlots::finishapplies it;capacity_report(SlotCounts, RetainedSnapshot)is the read model.SlotClassreplaces the reservedslot: usizethatcontrol_operation/hellotook.AdmissionClass::Lease,AdmissionReason::ReservedBusyand theCAPACITY_OPERATIONaliases are deleted:layerfs_bridge::control::OPERATIONis now the one name for the operator capacity/retained-failure read.Rebase
Rebased from
d788cc0aontoe9b903eac. One conflict,control/crates/layerfs-control/src/doctor/capacity.rs: #543 moved that query intolayerfs_sandbox::daemon::capacity, so that file takes the base version and the slice's localOPERATIONconst duplication stays deleted. Slice 2'sCAPACITY_OPERATION→OPERATIONrename was carried into the four call sites #543 added (daemon/capacity.rs,host/call.rs,api/tests/sandbox_capacity.rs,sandbox/tests/capacity_read.rs), so the rename does not resurrect the alias. No commits squashed.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 (including one this branch fixes), 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.