Commit Graph

25252 Commits

Author SHA1 Message Date
Petr Menšík
16ea60d8cc Reuse new function from rt46864 for similar block elsewhere.
(cherry picked from commit e7a93321f0)
(cherry picked from commit cb98ce8e67)
(cherry picked from commit 6876501605)
2018-02-23 13:57:12 -08:00
Mark Andrews
1deb60a53e Merge branch '82-cacheclean-test-is-not-robust-v9_11-v9_10' into 'v9_10'
Resolve "cacheclean test is not robust."

Closes #82

See merge request isc-projects/bind9!50
2018-02-22 12:49:30 +11:00
Mark Andrews
bf5fbdc983 add CHANGES entry
(cherry picked from commit 8c8ad74abe)
(cherry picked from commit 51e94baf50)
2018-02-22 12:49:17 +11:00
Mark Andrews
43d9078d90 check that sed selects a non zero range of lines
(cherry picked from commit 146c16c06e)
(cherry picked from commit e0c9b5bd2b)
2018-02-22 12:49:12 +11:00
Mark Andrews
9c0e109e75 Merge branch '67-stabilize-cacheclean-system-test-v9_10' into 'v9_10'
Stabilize cacheclean system test

Closes #67

See merge request isc-projects/bind9!43
2018-02-21 10:45:41 +11:00
Michał Kępień
3513a585e3 Improve the way cache contents are searched for "ns.flushtest.example"
During the "check flushtree clears adb correctly" check, expecting
"ns.flushtest.example" to always be the first name in the ADB dump is
fragile, because in a certain corner case "a.root-servers.nil" will be
the first name instead.

As the purpose of the relevant check is to ensure "ns.flushtest.example"
is removed from ADB by "rndc flushtree flushtest.example", search the
entire list of names present in ADB instead of just the first entry when
looking for "ns.flushtest.example".

(cherry picked from commit ca1049b2f3)
2018-02-21 10:38:51 +11:00
Michał Kępień
e617b91527 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)
2018-02-21 10:38:51 +11:00
Michał Kępień
dcd91ab322 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)
2018-02-21 10:38:42 +11:00
Michał Kępień
7679819e15 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)
2018-02-21 10:37:38 +11:00
Evan Hunt
8d20136739 [v9_10] add missing release note, update README 2018-02-17 20:04:06 -08:00
Michał Kępień
0c1061db57 Merge branch 'fix-loadpending-handling-v9_10' into v9_10 2018-02-16 09:00:25 +01:00
Michał Kępień
0e2b3e97a4 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 08:59:56 +01:00
Michał Kępień
fbc282e6bf 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 08:59:46 +01:00
Michał Kępień
dbec050c4e 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 08:59:46 +01:00
Michał Kępień
af8c5e4013 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 08:59:46 +01:00
Michał Kępień
3bc01f9452 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 08:59:46 +01:00
Mark Andrews
ecaaa42c6b Merge branch 'fix-cpp-check-errors' into 'v9_10'
Fix cpp check errors

See merge request isc-projects/bind9!31
2018-02-16 01:38:21 -05:00
Mark Andrews
29d304c630 s/cppchecker/cppcheck 2018-02-16 17:34:46 +11:00
Mark Andrews
a0a1b5f64d add GL issue number 2018-02-16 17:34:46 +11:00
Mark Andrews
06f6df737a add CHANGES note 2018-02-16 17:34:45 +11:00
Mark Andrews
4fdaf7e923 add POST(len); 2018-02-16 17:33:38 +11:00
Mark Andrews
3922e41963 conditionally declare stacksize 2018-02-16 17:32:35 +11:00
Mark Andrews
751ba7b551 add POST(len); 2018-02-16 17:31:00 +11:00
Mark Andrews
86ebdae0e0 Clarify calculation precedence for '&' and '?' 2018-02-16 17:28:25 +11:00
Mark Andrews
7ba538a21f add POST(tl) 2018-02-16 17:24:28 +11:00
Mark Andrews
0364226891 return failure count 2018-02-16 17:22:03 +11:00
Mark Andrews
cb3958cc6c conditionally declare strbuf 2018-02-16 17:20:28 +11:00
Mark Andrews
b6b9a1471b test for == 0 rather than <= as value is unsigned 2018-02-16 17:18:18 +11:00
Mark Andrews
47ef7460ef add brackets 2018-02-16 17:15:49 +11:00
Mark Andrews
fdb3dbf32f reorder test to silence cppcheck 2018-02-16 17:15:49 +11:00
Mark Andrews
7839571d34 remove event which is only used for sizeof 2018-02-16 17:15:49 +11:00
Mark Andrews
076135bf52 reorder test to silence cppcheck 2018-02-16 17:13:43 +11:00
Mark Andrews
b67cf8f2da use %u instead of %d 2018-02-16 17:12:51 +11:00
Mark Andrews
de535fee55 use %u instead of %d 2018-02-16 17:12:51 +11:00
Mark Andrews
6a724b765e use %u instead of %d 2018-02-16 17:12:03 +11:00
Mark Andrews
cb2c567e6d use %u instead of %d 2018-02-16 17:10:58 +11:00
Mark Andrews
c30a9cdaa3 use %u instead of %d 2018-02-16 17:10:02 +11:00
Mark Andrews
b5cc00e400 use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
dd27ab1f00 use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
50f978042e use %u instead of %d 2018-02-16 17:08:36 +11:00
Mark Andrews
a33e639d26 use %u instead of %d 2018-02-16 17:07:16 +11:00
Mark Andrews
cb29c18cfe case to unsigned; reorder expression 2018-02-16 17:05:11 +11:00
Mark Andrews
24f1d23185 simplify expression 2018-02-16 17:02:03 +11:00
Mark Andrews
a37769ca0d use %u and preserve unsigned property 2018-02-16 17:02:03 +11:00
Mark Andrews
8f3e807d19 cast to unsigned 2018-02-16 16:57:00 +11:00
Mark Andrews
f9195e267c preserve unsigned property 2018-02-16 16:57:00 +11:00
Mark Andrews
259c3ef8b8 use %u instead of %d 2018-02-16 16:54:19 +11:00
Mark Andrews
d81ec6ef5c make both arguments of & unsigned 2018-02-16 16:54:19 +11:00
Mark Andrews
cae75cd6e3 use %u instead of %d 2018-02-16 16:51:21 +11:00
Mark Andrews
0e7eb72847 shift unsigned (~0U) rather than signed (~0) contant 2018-02-16 16:48:53 +11:00