watcher: names say "usable reply", as their comments do (rework for #302)
check / check (push) Canceled after 0s

The function that decides the round could not reach the DNS, and its
test, are renamed to say no root server gave a usable reply, since a
root server's address that replied unusably counts the same.

Model: opus-5-5
This commit is contained in:
2026-10-18 14:45:15 +00:00
parent cc27d8d957
commit 4e39890c0a
2 changed files with 19 additions and 19 deletions
+7 -7
View File
@@ -299,16 +299,16 @@ func (w *Watcher) runDNSChecks(ctx context.Context) {
}
if ctx.Err() == nil {
w.dnsUnreachable.Store(noRootServerReplied(errs))
w.dnsUnreachable.Store(noRootServerGaveUsableReply(errs))
}
}
// noRootServerReplied reports whether errs, the errors of the lookups in
// a round of DNS checks, nil for a lookup that succeeded, show that
// every lookup failed because no root server gave a usable reply: each
// is ErrNoRootServerAnswered or ErrIntercepted. A round with no lookups
// shows nothing.
func noRootServerReplied(errs []error) bool {
// noRootServerGaveUsableReply reports whether errs, the errors of the
// lookups in a round of DNS checks, nil for a lookup that succeeded,
// show that every lookup failed because no root server gave a usable
// reply: each is ErrNoRootServerAnswered or ErrIntercepted. A round with
// no lookups shows nothing.
func noRootServerGaveUsableReply(errs []error) bool {
for _, err := range errs {
if !errors.Is(err, resolver.ErrNoRootServerAnswered) &&
!errors.Is(err, resolver.ErrIntercepted) {