Repository navigation
fix(lane): a lane started on a node checks its ports here, and the registry reads an entry again (#539) - #540
Merged
Merged
Conversation
…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>
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
#539 lists three siblings of #535 (bug class
race-on-start: a port range checked at one moment, held at another). Per point: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 byfree_range_forbefore the lease. A new number is said in the log (lane_renumbered).registry::listskipped 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.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 sayslane_renumbered from 1 to 2.remote-lanejob 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