resolver, watcher: a record type whose query fails keeps its previous records (closes #231)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
The resolver lists in FailedTypes each record type whose query to a nameserver got no usable reply (none after two tries, an error reply, a referral, or a truncated reply whose TCP retry failed), and logs it with the reason unless shutdown cut it short. A nameserver that answered no type has failed, as before. The watcher saves such a type in failedTypes, keeping the previous check's records, leaves it out of the comparison with other nameservers on that check, and compares the kept records with the next answer. With nothing to keep, it is also in unknownTypes and not compared until it answers. Change messages leave out what was not compared. A nameserver whose A, AAAA or CNAME query failed is no answer when following a CNAME or resolving addresses. Model: opus-5-5
This commit is contained in:
+11
-4
@@ -45,11 +45,18 @@ type DomainState struct {
|
||||
}
|
||||
|
||||
// NameserverRecordState holds one NS's response for a hostname.
|
||||
// FailedTypes lists the record types whose query to the nameserver
|
||||
// failed on this check: Records holds for them the records saved by the
|
||||
// previous check, which are kept. UnknownTypes lists those of them whose
|
||||
// records the previous check did not know either, as when the
|
||||
// nameserver was new or failing then: Records holds nothing for them.
|
||||
type NameserverRecordState struct {
|
||||
Records map[string][]string `json:"records"`
|
||||
Status string `json:"status"`
|
||||
Error string `json:"error,omitempty"`
|
||||
LastChecked time.Time `json:"lastChecked"`
|
||||
Records map[string][]string `json:"records"`
|
||||
FailedTypes []string `json:"failedTypes,omitempty"`
|
||||
UnknownTypes []string `json:"unknownTypes,omitempty"`
|
||||
Status string `json:"status"`
|
||||
Error string `json:"error,omitempty"`
|
||||
LastChecked time.Time `json:"lastChecked"`
|
||||
}
|
||||
|
||||
// HostnameState holds per-nameserver monitoring state for a hostname.
|
||||
|
||||
Reference in New Issue
Block a user