Skip to content

fix: ports held on 0.0.0.0 on Windows, one pool reporter per machine, containers apart in status (#226, #170, #184) - #234

Merged
7schmiede merged 3 commits into
mainfrom
fix/ports-reporters-status
Oct 23, 2026
Merged

7schmiede merged 3 commits into
mainfrom
fix/ports-reporters-status

Conversation

@7schmiede

Copy link
Copy Markdown
Member

Three fixes, one commit each.

Windows: a port another process holds on 0.0.0.0 counts as in use (#226)

On Windows a bind on 127.0.0.1 succeeds while a process of the same user listens on 0.0.0.0, so port_in_use took such a port to be free. devstack_proc::tcp_listening(port) now reads the system's TCP listener tables (GetExtendedTcpTable, TCP_TABLE_OWNER_PID_LISTENER, IPv4 and IPv6) and treats a listener on the wildcard address or on loopback as taken. Nothing listens on the wildcard (no firewall prompt), and there is no connect probe. One read of both tables costs about 0.3 to 0.6 ms (about 150 listeners on the machine), so range scans in lanes.rs stay cheap. a_port_held_on_every_address_is_in_use now runs on Windows too.

Closes #226

Hub and node agent on one machine no longer report over each other (#170)

The node agent holds node/lock in its membership's folder while it runs. If that lock is still held when it starts (the agent it replaces, or a hub checking it), it retries for 10 s. A second agent of the same member is refused. The hub's share loop does not report for a pool while the lock is held, and GET /hub/pool/share says so (agent). The new test share::tests::the_hub_does_not_report_over_a_node_agent_of_the_same_member uses a coordinator, the hub's round and an agent of the same member. Across the hub's rounds, the node keeps its API, and a running, shared lease keeps its created and its sharing. Once the agent stops, the hub reports again. Without the fix, the test fails on "the API stays".

Closes #170

devstack status: Compose containers get their own table (#184, part 3)

The SERVICE table is printed only for a stack that has [services.*] entries (or has nothing else). Containers are listed in a table of their own, CONTAINER / STATE / PORTS, by group. The devstack skill now says which table is which.

Closes #184

🤖 Generated with Claude Code

7schmiede and others added 3 commits October 23, 2026 12:35
On Windows a bind on 127.0.0.1 succeeds while a process of the same user
listens on 0.0.0.0 (a dev server started with `--host 0.0.0.0`, Docker
Desktop's published ports), so `port_in_use` took such a port to be free:
the start checks, the port ranges of lanes, the forwarded ports of lanes
on nodes and `devstack doctor`.

- `devstack_proc::tcp_listening(port)` reads the system's tables of TCP
  listeners (`GetExtendedTcpTable`, IPv4 and IPv6) and says whether one
  listens on the port on the wildcard address or on loopback. About
  0.3 ms per call for both tables (debug build), so range scans stay
  cheap. Nothing listens on the wildcard to ask (no firewall prompt), and
  there is no connect probe (seconds per closed loopback port).
- `port_in_use` asks it on Windows after the binds; Linux and macOS are
  unchanged.
- `a_port_held_on_every_address_is_in_use` runs on Windows too.

Closes #226

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On a machine where the hub and `devstack node agent` run for the same
pool, both reported as the same member every 15 s, and the coordinator
keeps only the last report. The hub's carries no API and no leases: after
each, placement took the machine for one without an agent, and its leases
were dropped, to come back with the agent's next report with a new
`created`, a new token and without their sharing (ADR-0035).

- The node agent holds `node/lock` in its membership's folder while it
  runs (`StateLock`); it waits a few seconds for one held by the agent it
  replaces, and refuses a second agent of the same member.
- The hub's share loop does not report for a pool while that lock is
  held; the agent reports the machine then, total and GPUs included.
  `GET /hub/pool/share` says so (`agent`).
- `StateLock::held` asks with a shared lock for a moment and creates
  nothing.
- A test with a coordinator, the hub's round and an agent of the same
  member: across the hub's rounds the node keeps its API and a running,
  shared lease its `created` and its sharing; once the agent stops, the
  hub reports again.

Closes #170

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…column

`devstack status` printed its `SERVICE` header for every stack and the
Compose groups below it, so a stack of containers only showed them under
`SERVICE`, while a service in the stack file and in "main ports" is a
`[services.*]` entry only.

- The service table shows when the stack has services (or nothing else).
- The containers follow in a table of their own, `CONTAINER`, `STATE`,
  `PORTS`, by group (`compose.<group> (<project>)`), as `devstack top`
  lists them apart already.
- The devstack skill says which is which.

Closes #184

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 96d2292 into main Oct 23, 2026
13 checks passed
@7schmiede
7schmiede deleted the fix/ports-reporters-status branch October 23, 2026 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant