]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Open the stale-refresh-time window on any resolver failure
authorOndřej Surý <ondrej@isc.org>
Thu, 14 May 2026 11:58:39 +0000 (13:58 +0200)
committerOndřej Surý <ondrej@isc.org>
Tue, 19 May 2026 09:18:30 +0000 (11:18 +0200)
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
lib/ns/query.c

index fbb9e8213b485920dfb5d487471b359a8005bab4..28cbf992502c272f120c0f7ce3a5b12cd4b4ead0 100644 (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;