Skip to content

fix(lane): a lane started on a node checks its ports here, and the registry reads an entry again (#539) - #540

Merged
7schmiede merged 1 commit into
mainfrom
fix/lane-claims-elsewhere
Nov 16, 2026
Merged

7schmiede merged 1 commit into
mainfrom
fix/lane-claims-elsewhere

Conversation

@7schmiede

Copy link
Copy Markdown
Member

What and why

#539 lists three siblings of #535 (bug class race-on-start: a port range checked at one moment, held at another). Per point:

  1. A lane started on a node forwards its ports here by its number, without the check fix(lane): a lane started here avoids the ports another stack claims (#535) #538 gave a start here. Now one rule decides for both: number_to_start (keep the number while its range is free of other stacks' claims and of other processes, else the first free one), applied by free_range_for before the lease. A new number is said in the log (lane_renumbered).
  2. A lane moved to a node, or back here keeps its number, on purpose: it holds its range here throughout (its own instances, then its forwards, or the other way round), so a move makes no new collision, and another number in the middle of a move would break the hand-over of its ports. If another stack numbers a lane onto that range meanwhile, that lane's start now finds the claim (fix(lane): a lane started here avoids the ports another stack claims (#535) #538, and point 3).
  3. registry::list skipped an entry it could not read or parse, without a word: its stack then looked as if it claimed nothing. A read is now tried again for up to 200 ms (on Windows the rename that replaces an entry can fail a reader for a moment); one that still fails is said in the log (registry_entry_unreadable), once per file. This is the one candidate for how the lane in A new lane's offset lands on ports another stack forwards for its lane on a node #535 got its number at all.

Checks

  • number_to_start: unit test for keep, claimed, held, nothing free.
  • read_entry: unit test with an entry half written and completed 30 ms later: red on the single read (None), green with the retry; gone and unparsable files.
  • End to end on Windows, isolated LOCALAPPDATA, no hub, this build: the case of A new lane's offset lands on ports another stack forwards for its lane on a node #535 (a claim on lane 1's port, nothing listening): the lane starts on +200, the log says lane_renumbered from 1 to 2.
  • Point 1 is not run end to end here: a start on a node needs Linux, Docker and a static build (the remote-lane job covers the start itself, not a claimed range).
  • cargo fmt --check, cargo clippy --workspace --all-targets --locked -D warnings, cargo test -p devstack-daemon (212).

Closes #539

🤖 Generated with Claude Code

…gistry reads an entry again (#539)

A lane started on a node forwards its ports here by its number, without
the check a start here got in #535: one rule now decides for both
(`number_to_start`, `free_range_for`), before the lease, and says a new
number in the log (`lane_renumbered`).

`registry::list` skipped an entry it could not read or parse: its stack
then looked as if it claimed nothing, and another stack's lane could be
numbered onto its ports. A read is tried again for up to 200 ms (on
Windows the rename that replaces an entry can fail a reader for a
moment); one that still fails is said in the log, once per file.

A lane moved to a node, or back here, keeps its number on purpose: it
holds its range here throughout, as its own instances or its forwards.

Closes #539

Bug-Class: race-on-start
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@7schmiede
7schmiede merged commit 9f7560e into main Nov 16, 2026
14 checks passed
@7schmiede
7schmiede deleted the fix/lane-claims-elsewhere branch November 16, 2026 13:54
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.

Lane starts on or moves to a node, and a lane moved back, skip the claims check of #538

1 participant