Commit d744a6fc authored by Evan Hunt's avatar Evan Hunt

Merge branch '1399-recursive-limit-stat' into 'master'

Resolve "recursive-client limit should have a stat counter"

Closes #1399

See merge request !2629
parents 0d7b3b9d 715afa9c
Pipeline #26447 passed with stages
in 1 minute and 26 seconds
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. 5326. [bug] Add python dependancy on 'distutils.core' to configure.
'distutils.core' is required for installation. 'distutils.core' is required for installation.
[GL #1397] [GL #1397]
......
...@@ -324,6 +324,9 @@ init_desc(void) { ...@@ -324,6 +324,9 @@ init_desc(void) {
"QryUsedStale"); "QryUsedStale");
SET_NSSTATDESC(prefetch, "queries triggered prefetch", "Prefetch"); SET_NSSTATDESC(prefetch, "queries triggered prefetch", "Prefetch");
SET_NSSTATDESC(keytagopt, "Keytag option received", "KeyTagOpt"); SET_NSSTATDESC(keytagopt, "Keytag option received", "KeyTagOpt");
SET_NSSTATDESC(reclimitdropped,
"queries dropped due to recursive client limit",
"RecLimitDropped");
INSIST(i == ns_statscounter_max); INSIST(i == ns_statscounter_max);
......
...@@ -179,5 +179,17 @@ echo_i "clients count exceeded 380 on $exceeded trials (expected 0)" ...@@ -179,5 +179,17 @@ echo_i "clients count exceeded 380 on $exceeded trials (expected 0)"
if [ $ret != 0 ]; then echo_i "failed"; fi if [ $ret != 0 ]; then echo_i "failed"; fi
status=`expr $status + $ret` 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" echo_i "exit status: $status"
[ $status -eq 0 ] || exit 1 [ $status -eq 0 ] || exit 1
...@@ -155,8 +155,11 @@ ns_client_killoldestquery(ns_client_t *client) { ...@@ -155,8 +155,11 @@ ns_client_killoldestquery(ns_client_t *client) {
ISC_LIST_UNLINK(client->manager->recursing, oldest, rlink); ISC_LIST_UNLINK(client->manager->recursing, oldest, rlink);
UNLOCK(&client->manager->reclock); UNLOCK(&client->manager->reclock);
ns_query_cancel(oldest); ns_query_cancel(oldest);
} else ns_stats_increment(client->sctx->nsstats,
ns_statscounter_reclimitdropped);
} else {
UNLOCK(&client->manager->reclock); UNLOCK(&client->manager->reclock);
}
} }
void void
......
...@@ -104,7 +104,9 @@ enum { ...@@ -104,7 +104,9 @@ enum {
ns_statscounter_tcphighwater = 65, ns_statscounter_tcphighwater = 65,
ns_statscounter_max = 66, ns_statscounter_reclimitdropped = 66,
ns_statscounter_max = 67,
}; };
void void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment