Repository navigation
fix(minimal,minimald,minimald-rpc): on a VM-backed host, min box stop frees declared ingress ports - #3710
fix(minimal,minimald,minimald-rpc): on a VM-backed host, min box stop frees declared ingress ports#3710minimal-foundry[bot] wants to merge 6 commits into
Conversation
A VM-backed host binds a declared forward toward the box's switch address. A box the host handed none published its name with every declared port dead. The finalize now fails with the reason first.
Adds the release_box_forwards control verb on the host socket. The egress gate unbinds the row's declared forwards and resets their connections, and the row stays live. The caller waits for the result, so a stop can return only after the ports are free (NET-121).
min box stop now asks the VM host daemon to release the stopped box's declared forwards and waits for the reply. A start right after the stop binds the ports again. A release the host does not confirm prints one line that a start can fail on a port in use.
|
Important Review skippedBot user detected. Ask an organization administrator to verify that this bot has an active assigned CodeRabbit review seat. See the seat-assignment guide. After the seat is confirmed, request a review again.
|
Spec lint
Advisory. None of this blocks the merge; the review decides. Advisory, and never a merge gate. Linter: |
|
/revise |
|
That What the platform saidcould not start the coder: Error: there is no container instance that can be provided to this durable object Nothing to type again: the command gets a rocket when its round starts, or a refusal that names the reason. No round was counted for it yet. |
…cked-host-min-box-stop-frees-declared
The release_box_forwards handler landed between rename_box and its doc comment, so the comment described the wrong function.
|
Round 1 of 10 on a /revise note, pushed as
Verify Converted to a draft: verify exited 101. On a VM-backed host, min box stop asks the VM host daemon to unbind the box's declared ports and waits for the answer, so a min box start of the same box right after binds its declared port again. A box that declares ingress ports and gets no network address from its VM fails activation with a message that says why, and no forward is bound for it. Notes from the agent: Revise round 1 (test-kvm failure at scripts/session-e2e.sh:8204, 'an uninstalled SHELL did not fall back to bash'). I found no code path in this PR that the failing case runs. (1) The case starts a box with |
|
/arch-review |
Follow-up
Fixes #3689
crates/minimald-rpc/src/lib.rscrates/minvmd/src/control.rscrates/minvmd/src/box_registry.rscrates/minvmd/src/net/egress_gate.rscrates/minimald/src/rpc.rscrates/minimal/src/cmd/boxes/vm_host.rscrates/minimal/src/cmd/boxes/lifecycle.rscrates/minimald/src/box_actor/setup.rscrates/minimald/src/box_actor/tests.rsdocs/specs/18-spec-box-networking/18-spec-box-networking.mdTask marker
Proof
On a VM-backed host,
min box stopnow sends the new release_box_forwards verb to the VM host daemon. It returns only after the daemon's egress gate unbinds the box's declared forwards and resets their connections. The row stays, so a start right after the stop binds the declared port again. The minvmd test shows the forward is unbound when the wait returns and that the same listener can be bound again at once. Separately, a VM-backed box that declares ingress and has no switch address now fails activation with this message: "box declares ingress ports, but its VM did not assign it a network address. No port can be forwarded to it. The box did not start." No forward is bound, and the cleanup leaves no record.Notes from the agent: Spec layer: the NET-121 block at the branch head had no VM-backed residual notes to remove, either on the sub-requirements or elsewhere in the NET-121 entry. I added three verify lines to NET-121 for the new tests and extended its comment to describe the VM-backed behaviour. Vale is not installed on this box, so
just lint-prosedid not run on the spec. The control handler takes no ApplyOrder ticket for the new verb, because the release changes no row and can wait up to 30 s (FORWARD_RELEASE_WAIT) for the gate. The CLI waits 35 s. A release that the host does not confirm does not fail the stop. It prints one line to stderr: "The VM did not confirm that the ports of are free.min box start <box>can fail while a port is still in use." Onlymin box stop(cmd_box_stop) calls the release.min session stop(crates/minimal/src/cmd/session.rs:427) andmin box stop --execare outside the layers and do not call it yet. The minimald activation test sets the daemon's switch to the VM host transport after the create, because box_actor tests had no VM-backed finalize fixture. The minvmd test drives the registry and the gate directly. It does not go through the control socket, so the wrapper in control.rs (release_box…[truncated]Tests
cargo test -p minvmd stopped_box_declared_forwards_released_before_stop_returnscargo test -p minimal box_stop_releases_declared_ports_on_vm_hostcargo test -p minimald activation_refused_when_vm_host_hands_no_switch_addresscargo test -p minvmd stopped_box_declared_forwards_released_before_stop_returnsVerify
min task run agent-verifyexited 101, so this PR is a draft.