resolver: a query cut short by the caller's context records no reason (closes #298)
check / check (push) Canceled after 0s
check / check (push) Canceled after 0s
When the caller's context ends, the next query returns ErrContextCanceled before anything is sent. querySingleType recorded that as a network error, which outranks a timeout, so a nameserver that had only timed out could be reported as "network error: context canceled". It now records no reason for it. Model: opus-5-5
This commit is contained in:
@@ -863,6 +863,10 @@ func (r *Resolver) querySingleType(
|
||||
if err != nil {
|
||||
err = fmt.Errorf("query %s @%s: %w", hostname, nsIP, err)
|
||||
}
|
||||
case errors.Is(err, ErrContextCanceled):
|
||||
// The caller's context ended and cut the query short. That
|
||||
// says nothing about the nameserver, so no reason is
|
||||
// recorded.
|
||||
case isTimeout(err):
|
||||
state.gotTimeout = true
|
||||
case errors.Is(err, ErrRefused):
|
||||
|
||||
Reference in New Issue
Block a user