Repository navigation
fix: DNS registration is skippable and no longer burns 4 min on a dead endpoint (#548, #549) - #552
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
… dead endpoint (#548, #549) present-but-silent-on-dns: unmarshaled it to false, silently disabling DNS registration. Add --no-dns, make DNSConfig.Enabled a tri-state (*bool) so "unspecified" != "explicitly false", and wire the guard in launch_single.go to consult it (CLI flag beats config file, matching --ttl's precedence). as always-transient, so a permanently-unresolvable dns.api_endpoint (stale config, or an account not wired for spore.host DNS — the expected case) burned the full 4-minute deadline on every launch (~$7.60/3-host fleet). Add a controller-side preflight resolve check before the SSH retry loop; only a definitive NXDOMAIN (net.DNSError.IsNotFound) short-circuits, so the genuinely-transient early-boot resolver case (up to ~90s) still retries as before.
scttfrdmn
force-pushed
the
fix/548-549-dns-registration
branch
from
August 20, 2026 20:06
c94a0f5 to
d4767be
Compare
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
Fixes #548 and #549 together — both touch the same DNS-registration guard in
cmd/launch_single.go, so they're combined to avoid a merge conflict between separate PRs.#549 — no way to skip DNS registration;
dns.enabledwas dead codedns.enabledin~/.spawn/config.yamlwas parsed but never consulted anywhere.bool, so any config file present but silent ondns:unmarshaledEnabledtofalseand silently disabled DNS registration for every named launch.--no-dnsflag.DNSConfig.Enabledis now a tri-state (*bool):nil= "unspecified, use the default (enabled)"; a config file that never mentionsdns:no longer disables anything.--no-dns) > config file (dns.enabled) > default (enabled) — matches the existing flag-over-config convention used by--ttletc.--no-dnsis distinct from--wait-for-ssh=false(e2e Tier 2 harness can't run ~22 launches in parallel — waitForRunning times out, SSH ControlMaster contention #56): it skips only DNS registration, not the SSH-readiness wait.#548 — DNS registration burned a hard 4-minute retry on a permanently-unresolvable hostname
registerDNS's retry loop treatedcurl exit 6(couldn't resolve host) as always-transient — correct for the guest's resolver not being populated yet at early boot (observed up to ~90s), wrong for a stale/placeholderdns.api_endpointor an account never wired for spore.host DNS (the expected case per the code's own comment).preflightDNSEndpoint) that resolves the endpoint hostname before entering the SSH retry loop. Only a definitive NXDOMAIN (net.DNSError.IsNotFound) short-circuits to the non-fatal warning immediately; a transient lookup failure (timeout, temporarily unreachable resolver) falls through to the existing retry loop unchanged.How they interact
--no-dns(#549) takes the #548 cost to zero for callers who use it. #548's own fix bounds the cost for everyone else (stale config, unaware of the flag, or genuinely wants DNS but the account isn't wired for it).Tests
pkg/config/config_test.go: tri-stateIsEnabled()behavior, andLoadDNSConfigprecedence — no config file (defaults enabled), config file present but silent ondns:(still enabled — the exact No way to skip DNS registration on a launch, anddns.enabledis parsed but never read #549 bug report),dns.enabled: falsealone,--no-dnsoverridingdns.enabled: true, both agreeing on disabled, and the plain "nothing set" default-proceeds case.cmd/launch_posthook_test.go:TestShouldAttemptDNSRegistration— the launch-flow guard's full decision table (no DNS name, SSH not confirmed, config disabled, config enabled/default, nil config).TestEndpointHostname/TestIsPermanentResolutionFailure— unit coverage for the URL-parsing and NXDOMAIN-classification helpers.TestPreflightDNSEndpoint_PermanentlyUnresolvable_ShortCircuits— permanent failure returns immediately (asserts wall-clock < 1s).TestPreflightDNSEndpoint_TransientFailure_DoesNotShortCircuit— the critical regression guard: timeout/temporary/generic errors must NOT be classified as permanent, or the genuinely-transient early-boot case would break.TestRegisterDNS_PermanentlyUnresolvable_SkipsSSHEntirely— end-to-end:registerDNSitself returns near-instantly (< 2s) for a permanently-unresolvable endpoint, proving the SSH retry loop (which sleeps 5s between attempts) was never entered.boolPtr,IsEnabled,endpointHostname,resolveHost,preflightDNSEndpoint,isPermanentResolutionFailure— that only exist with the fix), confirming the tests exercise the new code paths rather than trivially passing either way.go test -race ./cmd/... ./pkg/config/...passes clean.Process
CHANGELOG.mdupdated under## [Unreleased]with### Added(the--no-dnsflag) and### Fixed(both DNS registration burns a hard 4 minutes per launch oncurl exit 6, which is permanent whenever the endpoint hostname does not exist #548 and No way to skip DNS registration on a launch, anddns.enabledis parsed but never read #549) entries.make checkpasses clean (fmt, vet, short tests).make gen-docs/make check-docsrun;docs-gen/launch.mdregenerated and committed with the new--no-dnsrow.lambda/*/go.modsubmodules (go build+go mod tidy -diff) for drift per the batch's recurring gotcha — all clean, no changes needed.Test plan
go build ./...go vet ./...go test -race ./cmd/... ./pkg/config/...make checkmake gen-docs&&make check-docs(docs-gen committed)go build/go mod tidy -diffin alllambda/*/submodules — cleanspawn launch --helpshows the new--no-dnsflag with its help text