]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Wait until a cache dump completes instead of waiting for a fixed amount of time
authorMichał Kępień <michal@isc.org>
Tue, 20 Feb 2018 12:59:28 +0000 (13:59 +0100)
committerMark Andrews <marka@isc.org>
Tue, 20 Feb 2018 23:38:51 +0000 (10:38 +1100)
Dumping the cache is an asynchronous operation, so sleeping for a fixed
amount of time after running "rndc dumpdb" is imperfect as dumping cache
contents may take longer than expected on slower machines.  Instead of
always sleeping for 1 second, wait until the "; Dump complete" line
appears in the dump or 10 seconds pass, whichever comes first.

(cherry picked from commit 2bbff06d3631653fcea95e223da47aea0f9cdf0b)

bin/tests/system/cacheclean/tests.sh

index 652814c0d82eb2f328b81170aa87c2928f93295f..475dfa79b73842a29f98ade6671200d31b9ad07a 100644 (file)
@@ -64,7 +64,11 @@ EOF
 
 dump_cache () {
         $RNDC $RNDCOPTS dumpdb -cache _default
-        sleep 1
+        for i in 0 1 2 3 4 5 6 7 8 9
+        do
+                grep '^; Dump complete$' ns2/named_dump.db > /dev/null && break
+                sleep 1
+        done
         mv ns2/named_dump.db ns2/named_dump.db.$n
 }