Repository navigation
feat(resolution): a configurable resolution budget, and discoverPaths resolves once - #198
Merged
Merged
Conversation
… resolves once SwiftFTRConfig.resolutionTimeout (default 20 s), added through a further initializer, bounds the resolution wait of trace, traceClassified, traceStream, ping and discoverPaths. It must be finite and in (0, Int32.max] seconds, the rule PingConfig.timeout and StreamingTraceConfig.probeTimeout follow; validateForOperation rejects anything else, and ping now checks this one field of its tracer's configuration. discoverPaths resolves its target once, forced IPv4, inside its outcome and commit path and before its public-IP question, and hands the address to every flow, which keeps the caller's name for display. A name that does not resolve ends the run before any question or probe; the reported duration includes the lookup. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8mvWou2vH56zDnkZkqT2X
…ng once Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8mvWou2vH56zDnkZkqT2X
…ves it Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01A8mvWou2vH56zDnkZkqT2X
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.
Summary
PR #197 moved destination lookups off the tracer actor and gave them a fixed 20 s limit. This PR finishes that slice of docs/BLOCKING-IO.md (Resolution Off The Actor) in two ways.
SwiftFTRConfig.resolutionTimeout(decision 7). It is added through a further initializer, so existing code is unaffected.discoverPathsresolves once. Before, each of its flows looked the name up on its own, so a name with rotating DNS records could send different flows to different hosts, and their paths were then compared as if they shared one destination. Now the run resolves the name once, before it asks for the public address, and every flow probes that one address.Invariants
trace,traceClassified,traceStream,pingand thediscoverPathsparent wait for resolution at mostresolutionTimeout(default 20 s), under feat(resolution): resolve destinations off the actor, under one deadline #197's deadline rule. The value must be finite and in (0, Int32.max] seconds, the rule thatPingConfig.timeout,StreamingTraceConfig.probeTimeoutand the hybrid ASNfallbackTimeoutfollow (validatePositiveTimeout). Any other value throwsinvalidConfigurationfromvalidateForOperationbefore anything is resolved, asked or sent. Ping now checks this one field of its tracer's configuration, and no other.discoverPathsparent resolves the target at most once, forced IPv4. It does this after input validation and before the public-IP question, inside its existing outcome and commit step, socancelActiveTraces()during resolution still reportsTracerouteError.cancelledand the caller's own cancellation reportsCancellationError.NetworkTopology.discoveryDurationstarts before the lookup.Caller-visible changes
SwiftFTRConfig.resolutionTimeoutandSwiftFTRConfig.defaultResolutionTimeout. The API check is clean.destinationHostis still the name the caller passed.resolutionFailedbefore the public-IP question. No STUN traffic is sent, no custom resolver is asked, and nothing is cached.discoveryDurationincludes the lookup.Reproduce
On
main, where each flow resolves for itself,discoverPathsResolvesOncefails (one call per flow, several addresses), and so dounresolvableTargetAsksNothingandcancelledDuringParentResolution(the custom resolver is asked).durationIncludesResolutionpasses onmain, because the flows' own lookups fall inside the measured span there. It guards the lookup's new place ahead of the question, and fails if the duration's start moves after it. The option tests need the new API.🤖 Generated with Claude Code
https://claude.ai/code/session_01A8mvWou2vH56zDnkZkqT2X