From: Ondřej Surý Date: Thu, 14 May 2026 11:58:39 +0000 (+0200) Subject: Open the stale-refresh-time window on any resolver failure X-Git-Url: http://git.ipfire.org/gitweb/index.cgi?a=commitdiff_plain;h=1af37e24b2bcbcd461366d5f52683fa87a211e19;p=thirdparty%2Fbind9.git 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 Assisted-by: Claude:claude-opus-4-7 --- diff --git a/lib/ns/query.c b/lib/ns/query.c index fbb9e8213b4..28cbf992502 100644 --- a/lib/ns/query.c +++ b/lib/ns/query.c @@ -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;