Improve handling of failing dns resolvers

This commit is contained in:
Daniel 2020-07-20 16:42:21 +02:00
parent 8dea8e6c46
commit 25a3f6053d
2 changed files with 6 additions and 8 deletions

View file

@ -302,18 +302,16 @@ resolveLoop:
// we are offline and this is not an online check query
return nil, ErrOffline
default:
// includes ErrTimeout
log.Tracer(ctx).Debugf("resolver: failed to resolve %s: %s", q.FQDN, err)
}
} else {
// no error
}
if rrCache == nil {
// defensive: assume NXDomain
return nil, ErrNotFound
continue
}
break resolveLoop
}
}
}
// check for error
if err != nil {

View file

@ -28,7 +28,7 @@ const (
var (
// FailThreshold is amount of errors a resolvers must experience in order to be regarded as failed.
FailThreshold = 5
FailThreshold = 20
)
// Resolver holds information about an active resolver.