]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix the resolvers RTT-ranged responses statistics counters
authorAram Sargsyan <aram@isc.org>
Thu, 6 Mar 2025 14:28:48 +0000 (14:28 +0000)
committerAram Sargsyan <aram@isc.org>
Mon, 31 Mar 2025 18:35:45 +0000 (18:35 +0000)
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.

(cherry picked from commit 830e54811168bc3e69db93baf6132c18f3452f92)

lib/dns/resolver.c

index f8536e6f580ce6180bf424bb5fbfc45b66818636..0220bbd6bf5be02a6477608717b1c99df4c9983e 100644 (file)
@@ -8472,6 +8472,9 @@ rctx_timedout(respctx_t *rctx) {
                fctx->timeout = true;
                fctx->timeouts++;
 
+               rctx->no_response = true;
+               rctx->finish = NULL;
+
                isc_time_now(&now);
                /* netmgr timeouts are accurate to the millisecond */
                if (isc_time_microdiff(&fctx->expires, &now) < US_PER_MS) {
@@ -8480,8 +8483,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;
                }