watcher: a hostname whose zone's nameservers all stop answering gets NS Failure (closes #284)
check / check (push) Waiting to run
check / check (push) Waiting to run
When none of the nameservers of a hostname's zone answered, the walk to them failed and the check was only logged. The walk now returns a NoAnswerError naming the nameservers of the zone it reached through a referral when none of them answers. When those are the nameservers the previous check saved for the name, each is saved as failed with the reason, so it gets an NS Failure and later an NS Recovery. A domain with no delegation of its own, whose NS lookup is that same walk, gets the same. A walk that fails before that zone, as when the host loses its network, is still only logged. Model: opus-5-5
This commit was merged in pull request #290.
This commit is contained in:
@@ -122,6 +122,34 @@ func (w *Watcher) RunTLSChecks(ctx context.Context) {
|
||||
w.runTLSChecks(ctx)
|
||||
}
|
||||
|
||||
// CheckHostnameResult exports checkHostnameResult for testing.
|
||||
func (w *Watcher) CheckHostnameResult(
|
||||
ctx context.Context,
|
||||
hostname string,
|
||||
results map[string]*resolver.NameserverResponse,
|
||||
err error,
|
||||
) bool {
|
||||
return w.checkHostnameResult(ctx, hostname, results, err)
|
||||
}
|
||||
|
||||
// CheckDomainResult exports checkDomainResult for testing.
|
||||
func (w *Watcher) CheckDomainResult(
|
||||
ctx context.Context,
|
||||
domain string,
|
||||
nameservers []string,
|
||||
err error,
|
||||
) {
|
||||
w.checkDomainResult(ctx, domain, nameservers, err)
|
||||
}
|
||||
|
||||
// FailedNameservers exports failedNameservers for testing.
|
||||
func FailedNameservers(
|
||||
err error,
|
||||
prev *state.HostnameState,
|
||||
) map[string]*resolver.NameserverResponse {
|
||||
return failedNameservers(err, prev)
|
||||
}
|
||||
|
||||
// BuildHostnameState exports buildHostnameState for testing.
|
||||
func BuildHostnameState(
|
||||
results map[string]*resolver.NameserverResponse,
|
||||
|
||||
Reference in New Issue
Block a user