]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
add a stats counter for clients dropped due to recursive-clients limit
authorEvan Hunt <each@isc.org>
Tue, 26 Nov 2019 05:28:10 +0000 (21:28 -0800)
committerEvan Hunt <each@isc.org>
Tue, 26 Nov 2019 17:55:06 +0000 (17:55 +0000)
CHANGES
bin/named/statschannel.c
bin/tests/system/fetchlimit/tests.sh
lib/ns/client.c
lib/ns/include/ns/stats.h

diff --git a/CHANGES b/CHANGES
index 1cd85378c720929aeb55d0012451543c95d953eb..b0d9930766c554cd0cb6773d6554a64c90528c7b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,7 @@
+5327.  [func]          Added a statistics counter to track queries
+                       dropped because the recursive-clients quota was
+                       exceeded. [GL #1399]
+
 5326.  [bug]           Add python dependancy on 'distutils.core' to configure.
                        'distutils.core' is required for installation.
                        [GL #1397]
index a955d7b207fb2ae8d6e4eb7fc6af72d25c2a5008..c125b659cfb9158da1ca9490add93a0c867ae097 100644 (file)
@@ -324,6 +324,9 @@ init_desc(void) {
                       "QryUsedStale");
        SET_NSSTATDESC(prefetch, "queries triggered prefetch", "Prefetch");
        SET_NSSTATDESC(keytagopt, "Keytag option received", "KeyTagOpt");
+       SET_NSSTATDESC(reclimitdropped,
+                      "queries dropped due to recursive client limit",
+                      "RecLimitDropped");
 
        INSIST(i == ns_statscounter_max);
 
index 747ae07dfc9891e323ac4eb871bf35b6c190089b..3065060d06f83cb48bd10712221948533d4fa672 100644 (file)
@@ -179,5 +179,17 @@ echo_i "clients count exceeded 380 on $exceeded trials (expected 0)"
 if [ $ret != 0 ]; then echo_i "failed"; fi
 status=`expr $status + $ret`
 
+echo_i "checking drop statistics"
+rm -f ns3/named.stats
+$RNDCCMD stats
+for try in 1 2 3 4 5; do
+    [ -f ns3/named.stats ] && break
+    sleep 1
+done
+drops=`grep 'queries dropped due to recursive client limit' ns3/named.stats | sed 's/\([0-9][0-9]*\) queries.*/\1/'`
+[ "${drops:-0}" -ne 0 ] || ret=1
+if [ $ret != 0 ]; then echo_i "failed"; fi
+status=`expr $status + $ret`
+
 echo_i "exit status: $status"
 [ $status -eq 0 ] || exit 1
index 8cd8226549a3a0e1ca868dced90fce14523ea2b5..cf8467316f13080e097e6afdf1afa4b2a246fdb9 100644 (file)
@@ -155,8 +155,11 @@ ns_client_killoldestquery(ns_client_t *client) {
                ISC_LIST_UNLINK(client->manager->recursing, oldest, rlink);
                UNLOCK(&client->manager->reclock);
                ns_query_cancel(oldest);
-       } else
+               ns_stats_increment(client->sctx->nsstats,
+                                  ns_statscounter_reclimitdropped);
+       } else {
                UNLOCK(&client->manager->reclock);
+       }
 }
 
 void
index 175813113ebffa3ff6f5f797499c533e044869cf..8afe14260f1aa578b70843732e011d7de9ca67b0 100644 (file)
@@ -104,7 +104,9 @@ enum {
 
        ns_statscounter_tcphighwater = 65,
 
-       ns_statscounter_max = 66,
+       ns_statscounter_reclimitdropped = 66,
+
+       ns_statscounter_max = 67,
 };
 
 void