resolver: surface timeout-recheck stats and keep timeout-only domains suspect

This commit is contained in:
beckline
2026-02-25 09:39:53 +03:00
parent 90c4a73473
commit 5bd7f1c9f4
2 changed files with 11 additions and 1 deletions

View File

@@ -1813,8 +1813,18 @@ func (s *domainCacheState) setErrorWithStats(domain string, source domainCacheSo
if entry == nil {
entry = &domainCacheEntry{}
}
prevKind, _ := normalizeCacheErrorKind(entry.LastErrorKind)
entry.Score = clampDomainScore(entry.Score + penalty)
entry.State = domainStateFromScore(entry.Score)
// Timeout-only failures are treated as transient transport noise by default.
// Keep them in suspect bucket (no quarantine) unless we have NX signal.
if normKind == dnsErrorTimeout && prevKind != dnsErrorNXDomain {
if entry.Score < -10 {
entry.Score = -10
}
entry.State = domainStateSuspect
}
entry.LastErrorKind = string(normKind)
entry.LastErrorAt = now
switch entry.State {