Repository navigation
feat: a restart of the stack carries its lanes over to the next daemon (ADR-0052) - #211
Merged
Merged
Conversation
…n (ADR-0052) "Restart stack" with a lane running restarted only the main tree's services in the old daemon, so the banner "runs devstack X, Y is installed" stayed until every lane was stopped (seen in the pool's telemetry: three restarts in 30 s, each answered by the old daemon). A daemon told `POST /v1/shutdown?restart=true` (the hub's `down?restart=true`, the dashboard's restart) now notes what runs, keeps the leases of its lanes on nodes renewed until it is done, and writes `.devstack/restart.json`. The next daemon (within two minutes) renews those leases and follows the lanes again (sync, renewal, ports here), starts the lanes here again from the builds they ran, and gives the main slot back to its lane once the main tree's `up` is done. A crash or a plain stop is unchanged. `daemon.json` says `carries_lanes`; the dashboard's confirmation and banner say what happens to which lane, or that an older daemon stops them. Telemetry: lane_carried, lane_not_carried, main_slot_carried, daemon_stopping with the lanes by place, daemon_outdated from the hub. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7schmiede
force-pushed
the
feat/restart-carries-lanes
branch
from
October 22, 2026 09:51
4088abd to
b1df026
Compare
…anes The lane's processes of the old daemon may hold its ports a moment after it exited (Windows CI: 365 ms later), and a start that finds them taken moves the lane to another range: the next daemon now waits up to 30 s for the lane's own ports. The lifecycle tests' free_port() no longer takes a port above 64000, which left no room for a lane (`port_step` 100). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The lifecycle tests took a stack's fixed ports from `bind(0)`, inside the range the OS hands out for instance ports too: after a restart, which starts the main tree and the carried lane at once, an instance got the lane's fixed web port first (Linux CI, "forward on port ...: in use"). Real stacks' fixed ports lie below; the tests now take theirs from 20000-29999. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`devstack up` in the main tree waited until every autostart service was healthy; one that a lane serving the main ports took over stays stopped, so the wait never ended. After a restart the carried lane gets the main slot back right after the main tree's `up`, and the CLI could miss the healthy state in between (the remote-lane test hung twice). A stopped service counts as settled while a lane serves the main ports. CI: the remote-lane job ends after 30 minutes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Seen in the pool's telemetry (2026-10-22): a member's dashboard said " runs devstack 0.15.0, devstack 0.18.0 is installed"; "Restart stack" was pressed three times in 30 s, and each time the 0.15.0 daemon answered, because a lane ran on a node (18 h by then) and a restart with lanes running only restarted the main tree's services in the old daemon. The banner went only after the lane was stopped and the stack stopped and started.
ADR-0052 (new, Accepted at the owner's request in this session): a restart is a stop that leaves word for the next daemon.
POST /v1/shutdown?restart=true(hub:POST /hub/stacks/{id}/down?restart=true, the dashboard's "Restart stack"): the daemon notes what runs, stops as before, but keeps the leases of its lanes on nodes renewed until it is done, then writes.devstack/restart.json(lanes here with their profile, lanes on nodes with lease and ports, who serves the main ports).upis done. A lane that cannot be taken up is said, with the lane (itsmovingerror) and in the log.down,down --all: unchanged (ADR-0016, ADR-0024 point 6, ADR-0025 point 7 for those; both points marked amended).daemon.json/ the hub's stack entry saycarries_lanes; the dashboard's restart confirmation and the version banner say which lanes keep running on their node and which restart here, or that an older daemon stops them (then the confirmation is marked dangerous).lane_carried,lane_not_carried,main_slot_carried/main_slot_not_carried,remote_lane_left,daemon_stoppingwithrestartand the lanes by place, and from the hubdaemon_outdatedonce per stack and daemon release (how long stacks stay on an old release).Tests:
daemon_lifecycle::a_worktree_runs_as_a_lanerestarts with a local lane running and checks it comes back in a new daemon from its build (passed locally on Windows);remote_lanerestarts with a lane on the node that holds the main slot and checks the lease is renewed, the node's containers ran on, the lane's port and the main port answer again. UI logic inui/src/lib/lanes.tswith tests.🤖 Generated with Claude Code