]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Exempt prefetches from the fetches-per-zone quota
authorAram Sargsyan <aram@isc.org>
Fri, 7 Jun 2024 16:19:40 +0000 (16:19 +0000)
committerArаm Sаrgsyаn <aram@isc.org>
Mon, 26 Aug 2024 15:50:21 +0000 (15:50 +0000)
Give prefetches a free pass through the quota so that the cache entry
for a popular zone could be updated successfully even if the quota for
it is already reached.

lib/dns/resolver.c

index ee0ca2ee2deead241d3f25e96d8fe1d9b6592f73..b1c98f2faa82b74c4dc616af630864bfac3d9288 100644 (file)
@@ -4661,13 +4661,18 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
        }
 
        /*
-        * Are there too many simultaneous queries for this domain?
+        * Exempt prefetch queries from the fetches-per-zone quota check
         */
-       result = fcount_incr(fctx, false);
-       if (result != ISC_R_SUCCESS) {
-               result = fctx->res->quotaresp[dns_quotatype_zone];
-               inc_stats(res, dns_resstatscounter_zonequota);
-               goto cleanup_nameservers;
+       if ((fctx->options & DNS_FETCHOPT_PREFETCH) == 0) {
+               /*
+                * Are there too many simultaneous queries for this domain?
+                */
+               result = fcount_incr(fctx, false);
+               if (result != ISC_R_SUCCESS) {
+                       result = fctx->res->quotaresp[dns_quotatype_zone];
+                       inc_stats(res, dns_resstatscounter_zonequota);
+                       goto cleanup_nameservers;
+               }
        }
 
        log_ns_ttl(fctx, "fctx_create");