Repository navigation
fix(caller): a slow unrelated name holds a ready tailnet candidate back for the LAN head start only - #64
Merged
Conversation
…ack for the LAN head start only A hostname being resolved may turn out to be LAN, so the tailnet waits for it, but now only for LAN_HEAD_START_MS. Before, a slow lookup of an unrelated name held a ready numeric tailnet candidate back until the lookup ended. Public, tunnel and SSH still wait for every name, and a name that resolves to the LAN within the head start still keeps the LAN first.
…is resolved A name resolved to the tailnet may also hold public addresses, so it waits for the other names like public, tunnel and ssh candidates.
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.
A ready numeric tailnet candidate no longer waits for the lookup of an unrelated hostname to finish. A name that is still resolving may turn out to be LAN, so it still holds the numeric tailnet candidate back, but only for the existing
LAN_HEAD_START_MS(1000 ms by default). No new limit was added.Only numeric tailnet candidates start early. A name that resolved to a tailnet address may also hold public addresses (the dial tries every target), so it waits for the other names to resolve, as before.
What stays the same:
docs/limits.mdanddocs/phase1b-design.mddescribe the new bound.Result
Real loopback TLS to a paired host, with the numeric route labelled tailnet. An unrelated hostname is added whose lookup takes 1700 ms. Windows, 3 runs each:
The remaining ~1000 ms is the LAN head start, kept on purpose. The measurement harness is not part of this PR.
Tests
Three new tests in
crates/mousse-helper/tests/app_routes.rs:a_slow_name_holds_the_tailnet_back_for_the_lan_head_start_only: with a 60 s lookup, the numeric tailnet wins after at least the 1 s head start and in under 5 s. It fails on main: the search waits for the lookup.a_name_resolved_to_the_lan_within_the_head_start_beats_the_tailnet: a name that resolves to a LAN address after 300 ms wins, and the tailnet relay is never dialled.a_name_resolved_to_the_tailnet_waits_for_the_other_names: one name resolves at once to a tailnet address that refuses and then a public address that answers, while another name never resolves and gives up after 3 s. The public address is not dialled before 3 s. It fails against 010448b, the first version of this PR.Verification
Head
901b4ee, on maina15048a. Local checks on Windows:cargo fmt --all --checkpasses.cargo test -p mousse-helper --test app_routes: 52 of 52 pass.cargo test -p mousse-net-io: all pass.cargo clippy -p mousse-helper --test app_routes --all-features -- -D warningspasses.cargo clippy -p mousse-net-io --all-targets --all-features -- -D warningsstops on Windows atmissing_const_for_thread_localincrates/mousse-net-io/src/keystore.rs:1624. That initializer is alreadyconst, current main shows the same error, and this PR does not touch that file.On the first version (010448b), also on Windows:
cargo check -p mousse-net-core --target wasm32-unknown-unknownpasses.cargo test --workspace: everything else passes, apart from two Windows test failures that are not in this code and that pass on rerun:app_routes::an_inbound_connection_takes_the_class_of_the_port_it_arrived_onfailed withpeers.json: Access is denied (os error 5).app_invite_way::a_failed_selection_leaves_no_invitation_code_or_slotfailed because of an extrarelay.stateevent.cargo clippy --workspace --all-targets --all-features -- -D warningsstops at the samemissing_const_for_thread_locallint, incrates/mousse-helper/src/app/out.rs:53; that initializer is also alreadyconst.