From afb345b0e8a73c20264479282ac62ebaf6deb08f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 13 Aug 2024 12:48:23 +0200 Subject: [PATCH 1/2] Don't skip the counting if fcount_incr() is called with force==true (v2) The fcount_incr() was not increasing counter->count when force was set to true, but fcount_decr() would try to decrease the counter leading to underflow and assertion failure. Swap the order of the arguments in the condition, so the !force is evaluated after incrementing the .count. (cherry picked from commit 8e86e55af19f70d056b3a8f651d75500534463f6) --- lib/dns/resolver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/dns/resolver.c b/lib/dns/resolver.c index 78e0634aab..dd944f8670 100644 --- a/lib/dns/resolver.c +++ b/lib/dns/resolver.c @@ -1487,7 +1487,7 @@ fcount_incr(fetchctx_t *fctx, bool force) { INSIST(spill > 0); LOCK(&counter->lock); - if (!force && ++counter->count > spill) { + if (++counter->count > spill && !force) { counter->count--; INSIST(counter->count > 0); counter->dropped++; From 85d9311afe749e840f024af562fce95f122a1cb9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Tue, 13 Aug 2024 14:56:06 +0200 Subject: [PATCH 2/2] Add fetches-per-zone 40 to qmin/ns5 configuration The simple change causes assertion failure fixed in the previous commit. (cherry picked from commit c2c9d8f01b64dc1959d7a5141a99893930217906) --- bin/tests/system/qmin/ns5/named.conf.in | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/tests/system/qmin/ns5/named.conf.in b/bin/tests/system/qmin/ns5/named.conf.in index fb3101279a..f2382e5a8e 100644 --- a/bin/tests/system/qmin/ns5/named.conf.in +++ b/bin/tests/system/qmin/ns5/named.conf.in @@ -27,6 +27,7 @@ options { resolver-query-timeout 30000; # 30 seconds dnssec-validation no; disable-empty-zone 10.in-addr.arpa; + fetches-per-zone 40; }; key rndc_key {