From 1af37e24b2bcbcd461366d5f52683fa87a211e19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 14 May 2026 13:58:39 +0200 Subject: [PATCH] Open the stale-refresh-time window on any resolver failure MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- lib/ns/query.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ns/query.c b/lib/ns/query.c index fbb9e8213b..28cbf99250 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;