Repository navigation
fix(lane): a lane started here avoids the ports another stack claims (#535) - #538
Merged
Merged
Conversation
…535) A lane's start checked only whether one of its services' ports was in use at that moment. Another stack's lane on a node forwards its ports here only once its start there is done, so a lane started in between kept a number on ports another stack had claimed, and its services failed later with "port … is already in use". The start now also checks the claims of the other stacks on this machine (ADR-0082 point 5) against its whole range, its containers' host ports included, and takes another number when its range is claimed. Refs #535 Bug-Class: race-on-start Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 16, 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.
What and why
A lane started here could land on ports another stack claims for its lane on a node (#535). The start checked only whether one of its services' ports was in use at that moment; a lane on a node forwards its ports here only once its start there is done. A lane started in between kept its number, and its services failed a minute later with "port … is already in use by another process (devstack.exe)".
The start now also checks the claims of the other stacks on this machine (ADR-0082 point 5) against its whole range, its containers' host ports included, and takes another number when the range is claimed (
range_takeninlanes.rs).What the telemetry showed
On the reporter's machine (devstack 0.46.0), from the pool's telemetry:
apifails: the port is in use by A's daemonAt B's start, A had claimed those ports for 53 s; the new check sees that.
Not explained
Why B's lane got number 2 at 08:55:44, although the numbering (
free_number) checks the same claims and A had them for 30 s, is not explained by the data. A candidate:registry::listskips an entry it cannot read or parse without a word, so a read that meets the entry while its daemon replaces it would see no claims. Not proven; the start check now covers the effect.Checks
a_lane_start_finds_its_range_claimed_before_anything_listens: red on the old check (at the claim), green with the fix; a second wrong variant (claims checked on the services' ports only) is red too.LOCALAPPDATA, no hub: stack A with a worktree (lane 1, +100), then a registry entry of another stack claiming lane 1's port, nothing listening;devstack upin the worktree. 0.47.0: the lane starts on +100, on the claimed port. This build: it moves to +200; the claimed port stays free.cargo fmt --check,cargo clippy --workspace --all-targets --locked -D warnings,cargo test -p devstack-daemon.Bug class and siblings
race-on-start. Siblings, not in this PR:lane move --to local) takes over its ports by its number, without it.registry::list(above).Refs #535
🤖 Generated with Claude Code