watcher: names say "usable reply", as their comments do (rework for #302)
check / check (push) Canceled after 0s
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user