Improve handling of failing dns resolvers
This commit is contained in:
@@ -302,16 +302,14 @@ resolveLoop:
|
|||||||
// we are offline and this is not an online check query
|
// we are offline and this is not an online check query
|
||||||
return nil, ErrOffline
|
return nil, ErrOffline
|
||||||
default:
|
default:
|
||||||
|
// includes ErrTimeout
|
||||||
log.Tracer(ctx).Debugf("resolver: failed to resolve %s: %s", q.FQDN, err)
|
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
|
|
||||||
}
|
|
||||||
break resolveLoop
|
|
||||||
}
|
}
|
||||||
|
if rrCache == nil {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
break resolveLoop
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ const (
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
// FailThreshold is amount of errors a resolvers must experience in order to be regarded as failed.
|
// 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.
|
// Resolver holds information about an active resolver.
|
||||||
|
|||||||
Reference in New Issue
Block a user