Repository navigation
Closed
Labels
bugSomething isn't working
Description
Seen
A node of the maintainers' pool could no longer start a lane:
`docker network create --label devstack.lane=1 devstack-lane-…` failed (exit status: 1):
Error response from daemon: all predefined address pools have been fully subnetted
The engine had 30 bridge networks, the most Docker's default address pools hand out (15 × /16 from 172.17–31, 16 × /20 from 192.168). Two causes, one of them devstack's:
- Leaked lane projects (devstack bug). The Compose projects of two lanes of a downstream stack (
<project>-<slot>, 12 containers each, plus the lane's fixed-name network<name>-<slot>labelleddevstack.lane=1) had been running for 10 days. No lease holds them, and their slot directories are gone. That is 4 networks and 24 containers nobody owns. Their labels show they are this agent's:com.docker.compose.project.working_dirandconfig_fileslie under the agent's…/node/slots/<slot>/. - Capacity. The other networks are legitimate: the host's own services, plus nine running lanes of another member (one network each). A shared host fills Docker's defaults quickly.
Why the projects stay
sweep_orphans(crates/devstack-node/src/node.rs) removes a slot directory without aslot.jsonwithremove_dir_all. It does not take the slot's projects down first. Onlypurge_slotdoes that, throughSlotRun::purge.- The same sweep removes
devstack-lane-*containers that no lease holds. The Compose projects the lane started next to its container are not touched, so they keep running. sweep_slotsonly knows the slots that still have a directory. Projects whose slot directory is gone are never looked at again.
Proposal
- In
sweep_orphans, also remove the Compose projects (containers, project networks, and the lane'sdevstack.lane=1networks of that slot) whose slot is neither held by a lease nor kept (slot.json) and whoseworking_dirlies under this agent's slots directory. That last condition matchesmounts_underand keeps another pool's agent's projects on the same engine untouched (ADR-0034). Keep their volumes, as a kept lane's data is kept (ADR-0038). - When a slot without
slot.jsongoes, take its projects down first. - Admission: a failed
docker network createwith "address pools … fully subnetted" is refused with a clear reason (the node has no network left), not reported as a lane failure.docs/pool.mdrecommendsdefault-address-poolswith small subnets (e.g.{"base": "10.200.0.0/16", "size": 24}) for a node on a shared host.
Tests
- A unit test for the ownership filter:
working_dirunder the agent's slots directory, slot unknown → removed; another root → kept. - On the node: after a restart of the agent, no project of a slot without a directory remains.
🤖 Generated with Claude Code
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
7schmiede commentedon Oct 30, 2026
Cleaned up by hand on the node (2026-10-30): both leaked slots also had a second project each,
<project>-search-<slot>(one container), next to<project>-<slot>. So the sweep must take every Compose project whose name ends in-<slot>, asslot_of_projectalready reads them. 28 containers and 6 networks removed; the 14 volumes are kept.