Repository navigation
devcloud 0.8.0: a host's tailnet node kind follows its lease (board #115) - #337
Merged
Merged
Conversation
…p<->lease) A lease write that changes the kind the node should be (ephemeral while leased) records the rejoin and starts devcloud-rejoin as a transient unit; the lease service restarts it while the node is behind, and the boot's tailnet attach converges the kind too. A non-ephemeral node, which a logout leaves listed under its name, is removed through the Tailscale API after its logout, so the new node keeps the name. `lease set keep` and `devcloud vm lease <n> keep --confirmed` remove a lease; the driver waits for the host to come back under its name as the new kind. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…ntry gone The logout measurement, the person's decision and the design choices in the spec's Surprises and Decision Log; §4.1, §6.5 and I16 describe the rejoin and `lease <n> keep`; the vm skill names it. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…r the driver Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…e end's departure Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…th client Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
The rejoin unit can log the node out right after `lease set` releases the lock, before SSH delivers its exit status. A lost connection (255, none, or a signal) whose output holds a rejoin line and then the lease is that host's answer: the label or record write and the wait follow it. Without a rejoin line the failure stays. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
When `lease keep` removed a host's lease and the label write after it failed, the VM kept its ttl label and its old lease, and the reaper's repair read no lease the same as a failed read. host_expires now tells a descriptor without a lease (KEPT) from a read that failed, and decide labels such a host kept and confirmed, dropping devcloud-expires: only a confirmed `up --keep` or `lease keep` leaves a host without a lease. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…lls a held node from none The old non-ephemeral node's id lived only in a local: a logout that took effect and then failed or timed out, or a host that stopped before the API removal, left the next join to find no node and be given <name>-1, the old node stranded. Its id is now recorded in the kind record (`remove`) before the logout and cleared once the API removed it or found it gone; every later OAuth join, at boot or in `devcloud rejoin`, removes a pending node before its `up`, and a node already of the right kind just has the removal retried. A removal that still fails joins anyway, keeps the id, and keeps the node behind so the lease service retries it. `joined` meant BackendState Running, but a Stopped or Starting backend still holds its node, which `up --auth-key` resumes as the kind it was joined as. The join now asks whether tailscaled holds a node (a Self.ID, or a state other than NeedsLogin, NoState, NeedsMachineAuth): one of the right kind gets a plain `up`, one behind leaves first. A rejoin whose status cannot be read is refused, changing nothing; the boot's fresh join still goes ahead, `up` then failing or joining. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…cannot know A leave whose logout failed before taking effect left the node held in `remove`; with the lease turned back, the next join deleted the active node and recorded it joined. The removal now reads the node held first: its id is dropped from `remove` without a delete, and nothing is removed while the status cannot be read. A logout that fails with the same node still held takes its id back out at once. A boot whose status could not be read joined as before, but recorded the wanted kind though `up` may have resumed a node of the other kind. It now records the kind unknown (and the name only if read), so the node stays behind and the lease service's rejoin settles it once the status reads. Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
…nd retrospective; the report's draft Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Sminos-Session: devcloud setup#639ca648 (macbook on macbook)
This was referenced Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Board #115 (api board; no closing keyword): a devcloud host's tailnet node kind now follows its lease at every change, not only at its first join. The node is ephemeral while the host is leased and non-ephemeral while it is kept, and it keeps the host's name either way. devcloud 0.7.0 → 0.8.0.
What the measurement changed. The ticket's open question, measured first on a throwaway VM:
tailscale logoutdoes not remove a non-ephemeral tagged node. The node stays listed, expired, under its name, and the next join gets<name>-1. A node's kind cannot change in place either; even--force-reauthmakes a new node. So a rejoin has to remove the old node through the Tailscale API. That needsdevices:core, and the person chose that option knowing its reach. The main session replaced the hosts' OAuth client: version 2 of the same secret now carriesauth_keys+devices:coreontag:devcloudonly. The old client, which also heldpolicy_file,dnsandusers, is revoked.What changed
/var/lib/devcloud/tailnet.json). A lease write that leaves the node behind startsdevcloud rejoinas the transient unitdevcloud-rejoin. The rejoin runs in this order:tailscale upas the wanted kind.The pending id stays until its removal succeeds, and the node the daemon holds is never removed. The lease service retries a rejoin while the node is behind, on kept hosts too. The boot's tailnet attach converges the same way, and an unreadable status claims no kind.
lease set keepremoves a lease.devcloud vm lease <n> keep --confirmedrelabels the VM kept, or updates an adoption's record. On a host'srejoin <kind>line the driver waits up to 10 minutes for the host to come back under its name. A complete answer survives the SSH cut the rejoin causes. The reaper relabels kept a VM whose host has no lease.Report:
docs/doperpowers/plans/2026-10-22-devcloud-lease-rejoin-report.md.Validation Evidence
python3 -m unittest discover -s devcloud/tests/unit(at d5e5a2a, the last code commit)Ran 677 tests … OKdevcloud vm lease dc-kpt-e642 2h; thenvm ssh dc-kpt-e642 -- trueand the API's device recordisEphemeral: true; the record says the old node was removed through the API--confirmed, then non-ephemeralvm lease dc-kpt-e642 keep; thenvm lease dc-kpt-e642 keep --confirmedkeep, confirmed 1, no expires; ssh exit 0vm adopt … --confirmed(keep),vm lease dc-adp-c8b4 20m, the lease service's release, the checks over a new SSH as the original login, a reset, SSH againhub.json, unit or nft table left; the node left the tailnet; login worked before and after the reset;lsno longer lists itsystemd-run … devcloud rejoin(on 5321a4e's and d5e5a2a's code) and a hard resetgcloud compute instances list,tailscale statusdc-VM and nodc-node left; deletion times in the reportdoperpowers:reviewer-high, three roundsci-gatemods-types, cancelled three times when itsnpm exec tsc -phung until the job's 10-minute limit (e.g. https://github.com/SSFSKIM/doperpowers/actions/runs/39714616472). This diff touches no mods code. Logged in the friction tracker (#304)Unresolved Review Findings
None from the reviews. The fix wave left four small points open; each is in
docs/doperpowers/TECH-DEBT.mdunder the driver's section, marked board #115:-1name kept after a late removal;Residue
downof a kept VM, the release of a kept adoption). A kept VM deleted while unreachable leaves its node listed with nothing to remove it. Hosts now hold adevices:coreclient, so the departure could remove its own node after the logout, and the driver could remove the node of a kept VM it deletes without a departure.dc-lgt-3d09. The measurement VM was deleted without its leave, so the desk still lists it; the person was asked to remove it by hand.Sminos-Session: devcloud setup#639ca648 (macbook on macbook)