From: Aram Sargsyan Date: Thu, 6 Mar 2025 14:28:48 +0000 (+0000) Subject: Fix the resolvers RTT-ranged responses statistics counters X-Git-Tag: v9.21.7~44^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=830e54811168bc3e69db93baf6132c18f3452f92;p=thirdparty%2Fbind9.git Fix the resolvers RTT-ranged responses statistics counters When a response times out the fctx_cancelquery() function incorrectly calculates it in the 'dns_resstatscounter_queryrtt5' counter (i.e. >=1600 ms). To avoid this, the rctx_timedout() function should make sure that 'rctx->finish' is NULL. And in order to adjust the RTT values for the timed out server, 'rctx->no_response' should be true. Update the rctx_timedout() function to make those changes. --- diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index a470f27a709..504fc0254fc 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -8049,6 +8049,9 @@ rctx_timedout(respctx_t *rctx) { fctx->timeout = true; fctx->timeouts++; + rctx->no_response = true; + rctx->finish = NULL; + now = isc_time_now(); /* netmgr timeouts are accurate to the millisecond */ if (isc_time_microdiff(&fctx->expires, &now) < US_PER_MS) { @@ -8059,8 +8062,6 @@ rctx_timedout(respctx_t *rctx) { } else { FCTXTRACE("query timed out; trying next server"); /* try next server */ - rctx->no_response = true; - rctx->finish = NULL; rctx->next_server = true; }