Skip to content

fix: a lane on a node forwards its TCP ports only, and says which UDP ports are not forwarded - #217

Merged
7schmiede merged 1 commit into
mainfrom
fix/udp-ports-not-forwarded
Oct 22, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/udp-ports-not-forwarded

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Short-term part of #192 (the UDP relay stays open; this does not close the issue).

devstack forwards TCP only. For a lane on a node, the node listed every published port of a started service whatever its protocol (initial_infra), and the requester listened on a UDP port's number as TCP (forward_port). A service publishing 53/tcp and 53/udp kept only one of the two.

What changes

  • Node (devstack-node/src/lanerun.rs): infra_ports, what the requester forwards, holds TCP ports only. The lane daemon's file keys ports and published with the protocol: 5432 for TCP (as every agent wrote it), 53/udp for another, so 53/tcp and 53/udp stay two entries.
  • Lane daemon (external.rs, supervisor/infra.rs): PortKey reads 5432, 5432/tcp and 53/udp. Loopback forwards, the node tunnel (infra_tunnel) and the container's links use TCP entries only; a UDP port shows as 5453/udp->dns:53 and is listed in the new ContainerView.not_forwarded (["5453/udp"]). In the (group, service, port) address cache a port's TCP entry wins.
  • Requester (remote.rs, lanes.rs): follow_state collects the containers' not_forwarded from the lane's /v1/stack (read as JSON, as before) into LaneView.not_forwarded; a change re-announces the lanes.
  • CLI: devstack lane list prints ! <lane>: UDP port 5353 is not forwarded to this machine (devstack forwards TCP only).
  • Dashboard: the lane's header line, the container row (tag) and the container page (banner) say the same.
  • Docs: docs/pool.md (where forwarding of remote lanes is described), docs/dashboard-api.md (ContainerView.not_forwarded, LaneView.not_forwarded, and node_warning added to the /v1/lanes field list where it was missing), the devstack skill.

Compatibility (ADR-0031 point 8)

  • Node <-> requester wire: unchanged shape. LaneState.infra_ports is still Vec<u16>, only without UDP ports. An older requester simply no longer listens on a UDP port's number as TCP.
  • New fields are additive with skip_serializing_if empty; the requester reads them as JSON, so an older lane daemon (or node) just does not say, and an older requester ignores them. The UI treats them as optional.
  • The lane daemon's file: written by the agent at start, read by the lane container's daemon, which is a copy of that same agent's binary (linux_binary, one per version); the 5 s refresh copies the agent's base, so an older daemon never reads a newer agent's keys. TCP keys stay bare numbers anyway, so only a file with a non-TCP port would differ, and a new daemon reads an older agent's file (bare numbers) as before.
  • An older node still lists UDP ports in infra_ports; a newer requester cannot tell them apart and still forwards them as TCP until the node is updated.

Tests

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings: clean (Windows).
  • cargo test -p devstack-daemon --lib (122), -p devstack-node --lib (70), -p devstack --bin devstack (47), -p devstack-skills: pass. New: a_udp_port_is_listed_with_its_protocol_and_not_forwarded (node), a_port_of_another_protocol_is_its_own_and_not_forwarded (lane file), a_lanes_ports_not_forwarded_are_listed_once_in_order (requester), a_lanes_ports_not_forwarded_are_said (CLI).
  • ui: npm run typecheck, npm test (64) pass; new notForwardedText test.
  • Not run: the Docker-on-Linux node integration test (crates/devstack-node/tests/lanerun.rs, opt-in).

🤖 Generated with Claude Code

… ports are not forwarded (#192)

devstack forwards TCP only. For a lane on a node, the node listed every
published port of a started service whatever its protocol, and the
requester then listened on a UDP port's number as TCP.

- The node leaves non-TCP ports out of the ports the requester forwards.
- The lane daemon's file keys a port with its protocol (`5432` for TCP, as
  before; `53/udp` for another), so a service's 53/tcp and 53/udp are two
  entries. The lane daemon forwards and tunnels TCP entries only.
- ContainerView and LaneView gain `not_forwarded` (`["5353/udp"]`): the
  lane's page, its container rows and `devstack lane list` say "UDP port
  5353 is not forwarded to this machine".
- docs/pool.md, docs/dashboard-api.md and the devstack skill note the
  limitation.

Short-term part of #192; the UDP relay stays open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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