Open the stale-refresh-time window on any resolver failure

The TCP-fallback fix in the previous commits means a query that would
previously have timed out on UDP now actually escalates to TCP, and a
TCP-side failure surfaces a non-ISC_R_TIMEDOUT result code to
query_usestale().  The trigger for DNS_DBFIND_STALESTART was previously
narrowed to ISC_R_TIMEDOUT, so the stale-refresh-time window stopped
opening for those clients.

Broaden the condition to any failure that has already cleared the
upstream DUPLICATE/DROP filtering in query_usestale() — the spirit of
the window is "the resolver tried and could not get a fresh answer",
not "the resolver timed out specifically".

Co-authored-by: Evan Hunt <each@isc.org>
Assisted-by: Claude:claude-opus-4-7
This commit is contained in:
Ondřej Surý 2026-05-14 13:58:39 +02:00
parent 59c00a6f31
commit 1af37e24b2
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41

View file

@ -7375,10 +7375,10 @@ query_usestale(query_ctx_t *qctx, isc_result_t result) {
}
/*
* Start the stale-refresh-time window in case there was a
* resolver query timeout.
* Start the stale-refresh-time window as there appears
* to have been a resolver query failure.
*/
if (qctx->resuming && result == ISC_R_TIMEDOUT) {
if (qctx->resuming) {
qctx->client->query.dboptions |= DNS_DBFIND_STALESTART;
}
return true;