Accepted startup timeouts can panic before DNS starts
perfloop-oss/coredns · Uncatalogued correctness
https://perfloop.ai/t/oss/case_j8b8kvre91
Verdict
VERIFIED · settled 2026-11-20 · pull request opened as coredns/coredns#8811
What happened: The check fails before this change and passes with it.
Hypothesis
An accepted zero startup timeout causes the Kubernetes startup callback to panic before checking whether its cache is synchronized. A configuration value intended to control the startup wait therefore becomes a startup failure instead of a bounded wait or a configuration error. How often operators use zero waits is unknown.
ParseStanza accepts any duration that time.ParseDuration parses at plugin/kubernetes/setup.go:241–250, without a positivity check. The documented startup_timeout option limits how long startup waits for informer synchronization (plugin/kubernetes/README.md:126–127 and 213–219). Kubernetes.InitKubeCache passes that stored value to time.NewTicker at line 317 before its first HasSynced check. The same source path accepts negative durations as well; the reduced executable witness is zero. The requested property does not assume whether zero should mean immediate startup or an invalid setting: either explicit rejection or safe supported behavior is preferable to an accepted configuration panicking later.
A new native Go test parsed a Kubernetes Corefile containing startup_timeout 0ns, initialized the actual cache entry, substituted the package's already-synchronized APIConnServiceTest controller, and invoked the returned startup callback. No API requests were made. `go test ./plugin/kubernetes -run '^$' -fuzz '^FuzzPerfloopAcceptedStartupDuration$' -fuzztime=3s -parallel=1 -timeout=60s` failed immediately on seed 0, before completing baseline coverage; it was not a completed fuzz search. The deterministic replay command `go test ./plugin/kubernetes -run '^TestPerfloopStartupDuration(Replay|Positive)$' -count=1 -v -timeout=60s` exited 1. TestPerfloopStartupDurationReplay reported `accepted startup_timeout 0ns panicked in onStart: non-positive interval for NewTicker`; the otherwise identical 1ns positive control passed. Virtual time bounded execution, and each test performed one parse/init/start/shutdown sequence. The scratch test and fuzz files were removed.
The smallest useful next proof is that accepted zero and negative boundary inputs cannot escape as startup panics, while positive waits still end on synchronization or timeout. A native boundary test is a provisional proof method, not a requirement for a particular repair or test layout. This is distinct from the API-limit ordering finding because it concerns the startup callback's duration precondition.
The current open-PR scan and inspected hunks in https://github.com/coredns/coredns/pull/8414, https://github.com/coredns/coredns/pull/8451, https://github.com/coredns/coredns/pull/8374 and https://github.com/coredns/coredns/pull/8067 do not change this callback or duration validation. The contribution guide names GitHub PR review. Recent merged path history remains a named gap because the local checkout is shallow and the bounded remote history read was refused. Targeted prior-finding searches for startup_timeout and InitKubeCache ticker returned no matches, without establishing repository-wide novelty.
Change to test: Ensure every accepted startup timeout is safe when the startup callback runs. Define zero-wait behavior or reject nonpositive durations during parsing, with clear configuration errors and unchanged positive-duration synchronization behavior.
Where it lives
Evidence
The check fails before this change and passes with it: `The Kubernetes Corefile parser rejects zero and negative startup_timeout values with a clear setup error, while leaving the default timeout and positive durations unchanged.`
Checks: 2 of 2 passed. Verification: no defect found.
Timeline
2026-11-20· Case opened2026-11-20· PR opened