resolver: a nameserver with a failed record type is not nodata (closes #253)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
classifyResponse set nodata when every record type that answered had no records, even when another type's query got no usable reply. That type is listed in FailedTypes and its records are unknown, so the nameserver has not said it has none. It now stays ok, the status README describes for a nameserver with a failed type, and nodata is set only when no type failed. The watcher saved nodata as ok already, so saved state is unchanged; the live test that rejects nodata no longer fails when one of a nameserver's queries is lost. Model: opus-5-5
This commit is contained in:
@@ -913,7 +913,9 @@ func isTimeout(err error) bool {
|
||||
|
||||
// classifyResponse sets the nameserver's status. One that answered no
|
||||
// record type has failed, and Error says why; one that answered some has
|
||||
// the status of those answers.
|
||||
// the status of those answers. It has no data only when every type
|
||||
// answered with no records: a type in FailedTypes may have records, so a
|
||||
// nameserver with one stays ok.
|
||||
func classifyResponse(resp *NameserverResponse, state queryState) {
|
||||
switch {
|
||||
case state.gotNXDomain && !state.hasRecords:
|
||||
@@ -933,7 +935,8 @@ func classifyResponse(resp *NameserverResponse, state queryState) {
|
||||
case state.gotReferral && !state.answered:
|
||||
resp.Status = StatusError
|
||||
resp.Error = "server returned a referral"
|
||||
case !state.hasRecords && !state.gotNXDomain:
|
||||
case !state.hasRecords && !state.gotNXDomain &&
|
||||
len(resp.FailedTypes) == 0:
|
||||
resp.Status = StatusNoData
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user