Repository navigation
fix(minimald): compile switch opening from the proxy's bound port - #2053
Conversation
The switch's hostname-proxy opening (the interim :port every own-address box's egress gate compiles) was built from the configured or default port, never re-pointed when the bind landed elsewhere. record_serving updated only the discovery field, so an unpinned daemon whose default port was busy left boxes unable to reach the proxy on the OS-chosen port it actually served on. Add SwitchClient::set_hostname_proxy_port, thread the switch through ServerState beside the copy the sessions manager owns, and have record_serving re-point the opening at the bound port (boxes dial the bound port on their shared loopback; the discovery field still carries the client-facing reported port). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
Warning Review limit reached
This review includes 2 billable files and costs up to $0.50. Or wait 32 minutes for your next included review. View limit detailsLimit details: You’ve used all 2 included reviews currently available. Review configuration: ⚙️ Run configuration
📒 Files selected for processing (2)
Comment |
|
[inbox-patch:clobber] This PR would revert recently merged workSimulating this merge shows it undoing commits that landed on the base branch within the last 3 day(s):
Before merging, restore the reverted region to its state on the base branch. The rest of this PR is unaffected. If a listed commit is one this PR intends to supersede, say so and merge — this check reports, it does not block. |
|
/review |
|
Approved: no findings at Nothing to do. Clobber: none: the removed |
Boxes read the opening once, at attach, so a box attached before the proxy was serving keeps the configured port. Name both ports and the reattach remedy in one warn line, and take the bound port as a plain u16 in the linux-only setter.
|
/review |
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABVhE2Lg
Defect
The hostname proxy's interim opening (the
:portevery own-address box'segress gate compiles at the node address, design §7.1) was built once from the
configured port in
ServerState::new, and never re-pointed when the proxyactually bound a different port.
record_servingupdated only the RPCdiscovery field (
ServerState.hostname_proxy_port), so an unpinned nativedaemon whose default port was busy (bind falls back to an OS-chosen port)
left its own-address boxes unable to reach the proxy at the port it really
served on.
Change
net/mod.rs: addSwitchClient::set_hostname_proxy_port, the missingmutable setter the session gates (
compiled_egress,SessionGate::for_session)needed to track the bound port.
server.rs: thread theArc<Mutex<SwitchClient>>throughServerStatebeside the copy
Manager::initowns, add aServerStateHandlemutator, andhave
HostProxyStartup::record_serving'sEgressarm re-point the switchopening at the port actually bound. The discovery field still carries the
client-facing
reported_port(which may differ in the VM publish-relocationcase); boxes dial the bound port on the loopback they share with the daemon.
warn_if_proxy_opening_missedmismatch warning (theopening always equals the bound port after this fix) and replace its test
with a behavioral test asserting
record_servingpoints the switch at thebound port.
Verification
cargo fmt --all --check— cleancargo clippy --workspace --all-targets --locked -- -D warnings— cleancargo test -p minimald— 857 passed; the newrecord_serving_points_the_switch_opening_at_the_bound_portpasses. 11pre-existing failures are the documented libtest shared-log-buffer artifact
(each passes in isolation; the canonical nextest runner isolates them per
process).