Skip to content

A node leaves a lane's Compose projects running when its slot goes without a purge #394

Closed

Description

@7schmiede

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:

  1. 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> labelled devstack.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_dir and config_files lie under the agent's …/node/slots/<slot>/.
  2. 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 a slot.json with remove_dir_all. It does not take the slot's projects down first. Only purge_slot does that, through SlotRun::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_slots only 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's devstack.lane=1 networks of that slot) whose slot is neither held by a lease nor kept (slot.json) and whose working_dir lies under this agent's slots directory. That last condition matches mounts_under and 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.json goes, take its projects down first.
  • Admission: a failed docker network create with "address pools … fully subnetted" is refused with a clear reason (the node has no network left), not reported as a lane failure. docs/pool.md recommends default-address-pools with 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_dir under 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

Activity

  1. added
    bug
    on Oct 30, 2026
  2. 7schmiede commented on Oct 30, 2026

    @7schmiede
    MemberAuthor

    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>, as slot_of_project already reads them. 28 containers and 6 networks removed; the 14 volumes are kept.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions