Commit Graph

24226 Commits

Author SHA1 Message Date
Michał Kępień
580fb63a68 Wait until a cache dump completes instead of waiting for a fixed amount of time
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 2bbff06d36)
(cherry picked from commit e617b91527)
2018-02-21 11:28:16 +11:00
Michał Kępień
44e946e9e9 Do not overwrite cache dumps
Unless configured otherwise in named.conf, "rndc dumpdb" causes a cache
dump to be written to a file called "named_dump.db" in the working
directory of the given named instance.  Repeatedly using this command
throughout different checks in the cacheclean system test causes cache
dumps for older checks to be overwritten, which hinders failure
diagnosis.  Prevent this by moving each cache dump to a check-specific
location after running "rndc dumpdb".

Furthermore, during the "check flushtree clears adb correctly" check,
dump_cache() is called twice without renaming the resulting files.
Prevent the first cache dump from being overwritten by moving it to a
different file before calling "rndc dumpdb" for the second time.

(cherry picked from commit aeea1faf01)
(cherry picked from commit dcd91ab322)
2018-02-21 11:26:58 +11:00
Michał Kępień
5c0afa76f7 Assign an index to each check in the cacheclean system test
This will enable storing per-check forensic data, which facilitates
troubleshooting test failures.

(cherry picked from commit 01de79b332)
(cherry picked from commit 7679819e15)
2018-02-21 10:52:43 +11:00
Evan Hunt
f8d31691b5 [v9_9] add missing release note, update README 2018-02-17 20:04:13 -08:00
Michał Kępień
45cbf528f7 Merge branch 'fix-loadpending-handling-v9_9' into v9_9 2018-02-16 09:03:53 +01:00
Michał Kępień
d55d1c9f92 Add CHANGES entry
4892.	[bug]		named could leak memory when "rndc reload" was invoked
			before all zone loading actions triggered by a previous
			"rndc reload" command were completed. [RT #47076]
2018-02-16 09:03:48 +01:00
Michał Kępień
13cc08ea67 Do not recheck DNS_ZONEFLG_LOADPENDING in zone_asyncload()
Remove a block of code which dates back to commit 8a2ab2b920, when
dns_zone_asyncload() did not yet check DNS_ZONEFLG_LOADPENDING.
Currently, no race in accessing DNS_ZONEFLG_LOADPENDING is possible any
more, because:

  - dns_zone_asyncload() is still the only function which may queue
    zone_asyncload(),

  - dns_zone_asyncload() accesses DNS_ZONEFLG_LOADPENDING under a lock
    (and potentially queues an event under the same lock),

  - DNS_ZONEFLG_LOADPENDING is not cleared until the load actually
    completes.

Thus, the rechecking code can be safely removed from zone_asyncload().

Note that this also brings zone_asyncload() to a state in which the
completion callback is always invoked.  This is required to prevent
leaking memory in case something goes wrong in zone_asyncload() and a
zone table the zone belongs to is indefinitely left with a positive
reference count.
2018-02-16 09:03:27 +01:00
Michał Kępień
b38c5d2840 Asynchronous zone load events have no way of getting canceled
Code handling cancellation of asynchronous zone load events was likely
copied over from other functions when asynchronous zone loading was
first implemented in commit 8a2ab2b920.  However, unlike those other
functions, asynchronous zone loading events currently have no way of
getting canceled once they get posted, which means the aforementioned
code is effectively dead.  Remove it to prevent confusion.
2018-02-16 09:03:27 +01:00
Michał Kępień
ec51b6d3d4 Only clear DNS_ZONEFLG_LOADPENDING in zone_asyncload() if zone loading is completed immediately
zone_load() is not always synchronous, it may only initiate an
asynchronous load and return DNS_R_CONTINUE, which means zone loading
has not yet been completed.  In such a case, zone_asyncload() must not
clear DNS_ZONEFLG_LOADPENDING immediately and leave that up to
zone_postload().
2018-02-16 09:03:27 +01:00
Michał Kępień
9c103120ad Lock zone before checking whether its asynchronous load is already pending
While this is not an issue in named, which only calls
dns_zone_asyncload() from task-exclusive mode, this function is exported
by libdns and thus may in theory be concurrently called for the same
zone by multiple threads.  It also does not hurt to be consistent
locking-wise with other DNS_ZONEFLG_LOADPENDING accesses.
2018-02-16 09:03:27 +01:00
Mark Andrews
0402b2121f Merge branch 'fix-cpp-check-errors' into 'v9_9'
Fix cpp check errors v9_9

See merge request isc-projects/bind9!32
2018-02-16 02:49:07 -05:00
Mark Andrews
292245ebbf s/cppchecker/cppcheck 2018-02-16 18:45:24 +11:00
Mark Andrews
f80160d467 add GL issue number 2018-02-16 18:45:24 +11:00
Mark Andrews
469bc9fd15 add CHANGES note 2018-02-16 18:45:23 +11:00
Mark Andrews
1832348d27 add POST(len); 2018-02-16 18:44:47 +11:00
Mark Andrews
2670173c43 conditionally declare stacksize 2018-02-16 18:44:47 +11:00
Mark Andrews
ca738505ec add POST(len); 2018-02-16 18:43:59 +11:00
Mark Andrews
622bf9256b add POST(tl) 2018-02-16 18:43:46 +11:00
Mark Andrews
4404fcb384 return failure count 2018-02-16 18:42:11 +11:00
Mark Andrews
7245f12d3e conditionally declare strbuf 2018-02-16 18:41:31 +11:00
Mark Andrews
192a119b5a test for == 0 rather than <= as value is unsigned 2018-02-16 18:41:31 +11:00
Mark Andrews
872543eca7 add brackets 2018-02-16 18:37:05 +11:00
Mark Andrews
5de799a1c8 reorder test to silence cppcheck 2018-02-16 18:37:05 +11:00
Mark Andrews
32166fae3b remove event which is only used for sizeof 2018-02-16 18:37:05 +11:00
Mark Andrews
a4d8e7526a reorder test to silence cppcheck 2018-02-16 18:36:17 +11:00
Mark Andrews
324039934d use %u instead of %d 2018-02-16 18:36:17 +11:00
Mark Andrews
a6a6928e7e use %u instead of %d 2018-02-16 18:35:49 +11:00
Mark Andrews
fb188d4795 use %u instead of %d 2018-02-16 18:32:54 +11:00
Mark Andrews
f7c7a87cb4 use %u instead of %d 2018-02-16 18:30:18 +11:00
Mark Andrews
810fdbe4e7 use %u instead of %d 2018-02-16 18:30:18 +11:00
Mark Andrews
f6e83e4108 use %u instead of %d 2018-02-16 18:30:18 +11:00
Mark Andrews
9d061a7864 use %u instead of %d 2018-02-16 18:29:17 +11:00
Mark Andrews
a6f0a302ea case to unsigned; reorder expression 2018-02-16 18:25:33 +11:00
Mark Andrews
fd0877d294 simplify expression 2018-02-16 18:23:12 +11:00
Mark Andrews
ef0fb20613 use %u and preserve unsigned property 2018-02-16 18:23:11 +11:00
Mark Andrews
6cc168d6d4 cast to unsigned 2018-02-16 18:17:59 +11:00
Mark Andrews
bc7adce774 preserve unsigned property 2018-02-16 18:17:59 +11:00
Mark Andrews
b7a4a93b0d use %u instead of %d 2018-02-16 18:17:59 +11:00
Mark Andrews
5ae3eb3cfb make both arguments of & unsigned 2018-02-16 18:17:59 +11:00
Mark Andrews
cc21083141 use %u instead of %d 2018-02-16 18:16:48 +11:00
Mark Andrews
13421f89a2 shift unsigned (~0U) rather than signed (~0) contant 2018-02-16 18:16:48 +11:00
Mark Andrews
1bc27d6b26 use %u instead of %d 2018-02-16 18:16:48 +11:00
Mark Andrews
f693b488e1 unsigned constants 2018-02-16 18:15:21 +11:00
Mark Andrews
fe9ab35df1 unsigned constants 2018-02-16 18:13:08 +11:00
Mark Andrews
b6e6160df8 use %u instead of %d 2018-02-16 18:10:41 +11:00
Mark Andrews
606aa56e4f use %u instead of %d 2018-02-16 18:10:41 +11:00
Mark Andrews
131d4c873e use %u instead of %d 2018-02-16 18:08:58 +11:00
Mark Andrews
b3d10f1a43 use %u instead of %d 2018-02-16 18:06:58 +11:00
Mark Andrews
922ada36b5 formally cast to int; use %u instead of %d 2018-02-16 18:05:01 +11:00
Mark Andrews
726eaefd3e formally cast to int 2018-02-16 18:05:01 +11:00