Skip to content

devcloud 0.9.0: a kept or adopted host's tailnet node is removed when it leaves for good (board #118) - #342

Merged
SSFSKIM merged 7 commits into
mainfrom
devcloud-node-removal
Oct 22, 2026
Merged

SSFSKIM merged 7 commits into
mainfrom
devcloud-node-removal

Conversation

@SSFSKIM

@SSFSKIM SSFSKIM commented Oct 22, 2026

Copy link
Copy Markdown
Owner

Board #118 (the api board; no closing line). It builds on #115 (PR #337): a kept or adopted devcloud host no longer leaves its tailnet node listed and expired when it leaves for good.

  • Host: devcloud depart, the spot reclaim and devcloud release read the held node's id before the logout and record it as pending in tailnet.json; ephemeral nodes are skipped, since a logout removes those. Right after the logout, a new step remove-node removes the pending ids through the Tailscale API, using SCRATCH drain repro (dp#10) — wontfix on sight #115's removal loop, factored out as steps.remove_pending. The release does this before it removes its units and credentials. A failed removal is recorded, and the run goes on.
  • Driver: after every VM delete that succeeded (down, down --force, the reaper), and after an adopted machine's verified release, driver/tailnet.py removes whatever the API still lists of that host:
    • It matches tag:devcloud plus a hostname exactly equal to the host's name, and removes each match by node id, named on the deletion's line.
    • It never raises, and it stays inside the bounded reaper's budget.
  • Out of scope: no sweep of orphan nodes, as the ticket's open question was not approved.
  • Docs and version: the spec gets §4.2, §4.3, §4.4, §6.5, Out of scope, Surprises, the Decision Log and Outcomes. The README is updated, and devcloud goes from 0.8.1 to 0.9.0.

Report: docs/doperpowers/plans/2026-10-22-devcloud-node-removal-report.md.

Validation Evidence

Claim Command Output
CI passes on the head ci-gate on fb58bc1 GREEN https://github.com/SSFSKIM/doperpowers/actions/runs/39736153551, all 8 gates PASS
The unit suite passes cd devcloud/tests/unit && python3 -m unittest discover -s . Ran 709 tests … OK
A kept VM's down leaves no node, after lease→keep live: up --keep --confirmed, then lease 2h, then lease keep --confirmed, then down dc-nrm-09a9, with the API's device list polled every 3 s both rejoins kept the name. The node left the API at 06:19:15Z, during the departure. The line read "departed and deleted" with no node note, so the host's own remove-node had removed it
down --force on an unreachable kept VM removes its node through the driver live: tailscaled stopped on dc-unr-9284, then down (refused), then down --force "deleted without its departure (unreachable); … its tailnet node n2v3…CNTRL removed through the Tailscale API"; the API lists nothing of it
An adopted machine's release leaves no node live: adopt … --confirmed of a hand-made Ubuntu 24.04 e2-small, then down dc-adp-ad0f, with the API polled the node was gone by 06:29:40Z, before the driver looked. On the machine, lifecycle.log shows status read, logout, status read, then the seed's token (the client fetch), then the unit removal; tailscale "Logged out."
The VMs were deleted the same day gcloud compute instances list, the API's device list none of this work's VMs and none of its dc- nodes, from 06:30Z
A removal that fails is logged and the departure, release or deletion completes test_departure (DepartNodeRemovalTest, ReleaseNodeRemovalTest), test_driver_tailnet, test_driver_adopt ReleaseRemovesTheNodeTest OK
Review doperpowers:reviewer-high, 3 rounds round 1 and round 2 each found one P2, fixed in cc89c73 and 7dbcdf4. Round 3's one P2 was the same failure class, closed at the boundary in 236bb53, and the review stopped there (the report has the rounds)

The live runs used the person's approvals, given through the main session on 2026-10-22: "Start, approve both (Recommended)" for one kept VM and one adoption, and "Approve (Recommended)" for a second kept VM, used for the unreachable case.

Residue

None.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)

… a deleted host's (WIP)

The departure, the spot reclaim and the release record the held node's id
before the logout and remove it through the API right after (remove-node),
through the rejoin's shared removal loop. The driver removes what the API
still lists of a host it deleted or whose release it verified: tag:devcloud
and the exact hostname, by node id. Driver tests not yet written.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
… it leaves for good

The departure, the spot reclaim and the release remove the host's own
non-ephemeral node right after the logout, through #115's removal loop.
The driver removes what the Tailscale API still lists of a VM it deleted
or an adoption whose release it verified: tag:devcloud and the exact
hostname, by node id, named on the deletion's line. Spec §4.2-§4.4, §6.5,
Out of scope and Decision Log; README.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…me is spent

The budget was checked only on entry; the secret read, token, listing and each
node deletion now check it first, and nodes not reached are named in the note.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
A response that closes before its Content-Length raises IncompleteRead, an
HTTPException and not an OSError, which escaped tailnet.remove.

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…remove never raises

Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
@SSFSKIM
SSFSKIM merged commit 706821d into main Oct 22, 2026
10 checks passed
@SSFSKIM
SSFSKIM deleted the devcloud-node-removal branch October 22, 2026 07:02
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