Commit 09ab2e8e authored by Mark Andrews's avatar Mark Andrews

Try to improve rrl timing

Add a +burst option to mdig so that we have a second to setup the
mdig calls then they run at the start of the next second.
parent cf648346
Pipeline #52993 failed with stages
in 25 minutes and 4 seconds
......@@ -80,7 +80,7 @@ burst () {
eval BURST_DOM="$BURST_DOM_BASE"
DOMS="$DOMS $BURST_DOM"
done
ARGS="+nocookie +continue +time=1 +tries=1 -p ${PORT} $* @$ns2 $DOMS"
ARGS="+burst +nocookie +continue +time=1 +tries=1 -p ${PORT} $* @$ns2 $DOMS"
$MDIG $ARGS 2>&1 | \
tr -d '\r' | \
tee -a full-$FILENAME | \
......@@ -92,7 +92,7 @@ burst () {
-e 's/;; .* status: NOERROR.*/NOERROR/p' \
-e 's/;; .* status: SERVFAIL.*/SERVFAIL/p' \
-e 's/response failed with timed out.*/drop/p' \
-e 's/;; communications error to.*/drop/p' >> $FILENAME
-e 's/;; communications error to.*/drop/p' >> $FILENAME &
QNUM=`expr $QNUM + $BURST_LIMIT`
}
......@@ -104,6 +104,7 @@ range () {
# $1=domain $2=IP address $3=# of IP addresses $4=TC $5=drop
# $6=NXDOMAIN $7=SERVFAIL or other errors
ck_result() {
wait
BAD=no
ADDRS=`egrep "^$2$" mdig.out-$1 2>/dev/null | wc -l`
# count simple truncated and truncated NXDOMAIN as TC
......
......@@ -87,6 +87,7 @@ static isc_mem_t *mctx;
static dns_requestmgr_t *requestmgr;
static const char *batchname;
static FILE *batchfp;
static bool burst = false;
static bool have_ipv4 = false;
static bool have_ipv6 = false;
static bool have_src = false;
......@@ -1222,18 +1223,29 @@ plus_option(char *option, struct query *query, bool global) {
GLOBAL();
besteffort = state;
break;
case 'u': /* bufsize */
FULLCHECK("bufsize");
if (value == NULL) {
goto need_value;
}
if (!state) {
case 'u':
switch (cmd[2]) {
case 'f': /* bufsize */
FULLCHECK("bufsize");
if (value == NULL) {
goto need_value;
}
if (!state) {
goto invalid_option;
}
result = parse_uint(&num, value, COMMSIZE,
"buffer size");
CHECK("parse_uint(buffer size)", result);
query->udpsize = num;
break;
case 'r': /* burst */
FULLCHECK("burst");
GLOBAL();
burst = state;
break;
default:
goto invalid_option;
}
result = parse_uint(&num, value, COMMSIZE,
"buffer size");
CHECK("parse_uint(buffer size)", result);
query->udpsize = num;
break;
default:
goto invalid_option;
......@@ -2044,6 +2056,21 @@ parse_args(bool is_batchfile, int argc, char **argv) {
}
}
#ifdef WIN32
static void
usleep(unsigned int usec) {
HANDLE timer;
LARGE_INTEGER ft;
ft.QuadPart = -(10 * (__int64)usec);
timer = CreateWaitableTimer(NULL, TRUE, NULL);
SetWaitableTimer(timer, &ft, 0, NULL, NULL, 0);
WaitForSingleObject(timer, INFINITE);
CloseHandle(timer);
}
#endif
/*% Main processing routine for mdig */
int
main(int argc, char *argv[]) {
......@@ -2152,6 +2179,27 @@ main(int argc, char *argv[]) {
query = ISC_LIST_HEAD(queries);
RUNCHECK(isc_app_onrun(mctx, task, sendqueries, query));
/*
* Stall to the start of a new second.
*/
if (burst) {
isc_time_t start, now;
RUNCHECK(isc_time_now(&start));
do {
RUNCHECK(isc_time_now(&now));
if (isc_time_seconds(&start) == isc_time_seconds(&now))
{
int t = 1000000 -
isc_time_nanoseconds(&now) / 1000;
if (t > 1000) {
usleep(t - 1000);
}
} else {
break;
}
} while (1);
}
(void)isc_app_run();
query = ISC_LIST_HEAD(queries);
......
......@@ -130,6 +130,9 @@ The global query options are:
This option attempts to display [or does not display] the contents of messages which are malformed. The
default is to not display malformed answers.
``+burst``
This option delays queries until the start of the next second.
``+[no]cl``
This option displays [or does not display] the CLASS when printing the record.
......
......@@ -132,6 +132,9 @@ default is to display it.
This option attempts to display [or does not display] the contents of messages which are malformed. The
default is to not display malformed answers.
.TP
.B \fB+burst\fP
This option delays queries until the start of the next second.
.TP
.B \fB+[no]cl\fP
This option displays [or does not display] the CLASS when printing the record.
.TP
......
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