2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 06:25:31 +00:00
Commit Graph

30574 Commits

Author SHA1 Message Date
Witold Kręcicki
ccd44b69e5 Fix a potential lock-order-inversion in tcp listening code 2019-12-10 10:05:15 +01:00
Witold Krecicki
01481dee1c Merge branch 'wpk/tcp-multithreaded' into 'master'
netmgr: make tcp listening multithreaded.

See merge request isc-projects/bind9!2659
2019-12-09 21:20:40 +00:00
Witold Kręcicki
83e54f906d CHANGES entry 2019-12-09 21:44:04 +01:00
Evan Hunt
31b3980ef0 shorten some names
reduce line breaks and general unwieldiness by changing some
function, type, and parameter names.
2019-12-09 21:44:04 +01:00
Evan Hunt
8c0792723d style nits 2019-12-09 21:44:04 +01:00
Witold Kręcicki
35679aef9b unittest: Allow for 32 (not 16) mock nmhandles in ns tests 2019-12-09 21:44:04 +01:00
Witold Kręcicki
a34ced776e Remove read callback before detaching from inner socket in tcpdns 2019-12-09 21:44:04 +01:00
Witold Kręcicki
86a847314a Fix a race in socket destruction - we need to remove handle from socket in async close callback or we might race between destruction in the callback and in the original nmhandle_unref 2019-12-09 21:44:04 +01:00
Witold Kręcicki
b804d3a395 always return true in ns_interfacemgr_listeningon if interfacemgr is shutting down
to avoid deadlocks on shutdown.
2019-12-09 21:44:04 +01:00
Witold Kręcicki
b0779cc429 netmgr: Add more DbC checks for asynchronous calls. 2019-12-09 21:44:04 +01:00
Witold Kręcicki
ef2dff5c7a pause and unpause netmgr in isc_nm_destroy to flush all events from worker queues 2019-12-09 21:44:04 +01:00
Evan Hunt
c7b86d1cac Style fixes 2019-12-09 21:44:03 +01:00
Witold Kręcicki
3e66b7ba1c Fix a race in tcpdns close with uv_close on timer
stop timers before closing

netmgr: tcpdns_close needs to be asynchronous, it manipulates sock->timer
2019-12-09 21:43:45 +01:00
Witold Kręcicki
23ab349bbd netmgr: fix a race in socket destruction, happening if we close the socket
externally and, at the same time, a timeout timer callback was called.
2019-12-09 21:43:45 +01:00
Witold Kręcicki
0bf74ac792 netmgr:
- make tcp listening IPC pipe name saner
 - put the pipe in /tmp on unices
 - add pid to the pipe name to avoid conflicts between processes
 - fsync directory in which the pipe resides to make sure that the
   child threads will see it and be able to open it
2019-12-09 21:43:45 +01:00
Evan Hunt
b05194160b style, comments 2019-12-09 11:15:27 -08:00
Witold Kręcicki
8c5aaacbef - Add separate priority event queue for events that must be processed
even when worker is paused (e.g. interface reconfiguration). This is
  needed to prevent deadlocks when reconfiguring interfaces - as network
  manager is paused then, but we still need to stop/start listening.

- Proper handling of TCP listen errors in netmgr - bind to the socket first,
  then return the error code.
2019-12-09 11:15:27 -08:00
Witold Kręcicki
5a65ec0aff Add uv_handle_{get,set}_data functions that's absent in pre-1.19 libuv to make code clearer.
This might be removed when we stop supporting older libuv versions.
2019-12-09 11:15:27 -08:00
Witold Kręcicki
bc5aae1579 netmgr: make tcp listening multithreaded.
When listening for TCP connections we create a socket, bind it
and then pass it over IPC to all threads - which then listen on
in and accept connections. This sounds broken, but it's the
official way of dealing with multithreaded TCP listeners in libuv,
and works on all platforms supported by libuv.
2019-12-09 11:15:27 -08:00
Ondřej Surý
09c2dbffb5 Merge branch '1443-threadsanitizer-data-race-lib-dns-rbtdb-c-1960-in-decrement_reference-2' into 'master'
Resolve "ThreadSanitizer: data race lib/dns/rbtdb.c:1960 in decrement_reference"

Closes #1443

See merge request isc-projects/bind9!2703
2019-12-09 18:48:35 +00:00
Mark Andrews
c6efc0e50f Add is_leaf and send_to_prune_tree.
Add is_leaf and send_to_prune_tree to make the logic easier
to understand in cleanup_dead_nodes and decrement_reference.
2019-12-09 17:43:54 +00:00
Mark Andrews
176b23b6cd Testing node->down requires the tree lock to be held.
In decrement_reference only test node->down if the tree lock
is held.  As node->down is not always tested in
decrement_reference we need to test that it is non NULL in
cleanup_dead_nodes prior to removing the node from the rbt
tree.  Additionally it is not always possible to aquire the
node lock and reactivate a node when adding parent nodes.
Reactivate such nodes in cleanup_dead_nodes if required.
2019-12-09 17:43:54 +00:00
Ondřej Surý
23e29b17db Merge branch '1453-the-zero-system-test-timeouts-intermittently' into 'master'
Bail-out early if dig fails to finish successfully or takes too long

Closes #1453

See merge request isc-projects/bind9!2712
2019-12-09 17:41:25 +00:00
Ondřej Surý
eb8007a5ba Merge branch '1458-intermittent-failure-in-the-forward-system-test' into 'master'
Resolve "Intermittent failure in the forward system test"

Closes #1458

See merge request isc-projects/bind9!2716
2019-12-09 17:15:53 +00:00
Ondřej Surý
2a65a47f39 Bail-out early if dig fails to finish successfully or takes too long
Before, the zero system test could get stuck almost infinitely, because
the first test sends > 300 queries with 5 seconds timeout on each in
each pass.  If named crashed early, it would took the test more than 4
hours to properly timeout.

This commit introduces a "watchdog" on the dig commands running in the
background and failing the test on timeout, failing any test if any dig
command fails to return successfully, and making the tests.sh script
shellcheck clean.
2019-12-09 18:15:18 +01:00
Ondřej Surý
fb03edacd8 Wait for named to forward the question before testing the validity 2019-12-09 17:30:37 +01:00
Ondřej Surý
0e15cbb092 Make forward system test shellcheck clean 2019-12-09 17:30:37 +01:00
Ondřej Surý
10f4cd066f Use $n to keep diagnostic output of every individual test separate 2019-12-09 17:30:37 +01:00
Ondřej Surý
64df488e1e Add the standard $n to each test 2019-12-09 17:30:37 +01:00
Ondřej Surý
12578b9e96 Merge branch '1425-intermittent-failure-in-the-addzone-system-test' into 'master'
Resolve "Intermittent failure in the addzone system test"

Closes #1425

See merge request isc-projects/bind9!2714
2019-12-09 16:27:31 +00:00
Witold Kręcicki
8885fd6966 tests: addzone: retry when checking for things, to allow for timing problems 2019-12-09 16:02:03 +00:00
Mark Andrews
9e8cd3ccc5 loop waiting for the redirect zone to load 2019-12-09 16:02:03 +00:00
Matthijs Mekking
6ff780db5b Merge branch '1466-kasp-test-keyid-0' into 'master'
Fix get key id from key_idpad

Closes #1466

See merge request isc-projects/bind9!2731
2019-12-09 14:42:08 +00:00
Matthijs Mekking
2e7cb4978f Fix get key id from key_idpad
The kasp system test has a call to sed to retrieve the key identifier
without leading zeros.  The sed call could not handle key id 0.
Update the kasp test to also correctly deal with this case.
2019-12-09 14:54:04 +01:00
Matthijs Mekking
910a7a56bc Merge branch '1457-intermittent-failure-autosign' into 'master'
Resolve "Intermittent failure in the autosign system test"

Closes #1457

See merge request isc-projects/bind9!2729
2019-12-09 13:29:36 +00:00
Matthijs Mekking
bd4035900a Better error handling in autosign system test 2019-12-09 13:38:54 +01:00
Matthijs Mekking
2e4273b55a Fix race in autosign test
The autosign test has a test case where a DNSSEC maintaiend zone
has a set of DNSSEC keys without any timing metadata set.  It
tests if named picks up the key for publication and signing if a
delayed dnssec-settime/loadkeys event has occured.

The test failed intermittently despite the fact it sleeps for 5
seconds but the triggered key reconfigure action should happen after
3 seconds.

However, the test output showed that the test query came in before
the key reconfigure action was complete (see excerpts below).

The loadkeys command is received:

15:38:36 received control channel command 'loadkeys delay.example.'

The reconfiguring zone keys action is triggered after 3 seconds:

15:38:39 zone delay.example/IN: reconfiguring zone keys
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7484 (ZSK) is now published
15:38:39 DNSKEY delay.example/NSEC3RSASHA1/7455 (KSK) is now published
15:38:39 writing to journal

Two seconds later the test query comes in:

15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: query
15:38:41 client @0x7f1b8c0562b0 10.53.0.1#44177: endrequest

And 6 more seconds later the reconfigure keys action is complete:

15:38:47 zone delay.example/IN: next key event: 05-Dec-2019 15:48:39

This commit fixes the test by checking the "next key event" log has
been seen before executing the test query, making sure that the
reconfigure keys action has been complete.

This commit however does not fix, nor explain why it took such a long
time (8 seconds) to reconfigure the keys.
2019-12-09 13:38:54 +01:00
Matthijs Mekking
cfaa631f65 Move wait_for_log to conf.sh.common 2019-12-09 13:38:54 +01:00
Matthijs Mekking
6b4a17ef7c Save settime output 2019-12-09 13:38:54 +01:00
Matthijs Mekking
edd6a084f0 Merge branch 'misc-fixes-kasp' into 'master'
Miscellaneous fixes kasp

See merge request isc-projects/bind9!2711
2019-12-09 08:22:56 +00:00
Matthijs Mekking
4b66c0ebf4 Change some dnssec-policy defaults
Suggested by Tony Finch, these seem to be more reasonable defaults.
2019-12-09 07:25:20 +00:00
Matthijs Mekking
0f9d45a5b8 Default key size 2048
The default size for RSA keys is 2048 bits, for both ZSKs and KSKs.
2019-12-09 07:25:20 +00:00
Matthijs Mekking
a339a6df48 Update docs with durations, built-in dnssec-policy
Clarify in the ARM that TTL-style options can also now take ISO
8601 durations.

Mention the built-in dnssec policies "default" and "none".  Mention
that "none" is the default.

Add a file documenting the default dnssec-policy configuration options.

Fix dnssec-policy syntax in ARM (dnssec-policy.grammar.xml).
2019-12-09 07:25:20 +00:00
Ondřej Surý
6f096f5245 Merge branch 'ondrej/remove-too-generic-node_count-macro-from-dns_acl' into 'master'
Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace

See merge request isc-projects/bind9!2725
2019-12-09 06:49:00 +00:00
Ondřej Surý
8120088ec7 Change the (acl)->node_count macro to dns_acl_node_count(acl) macro to clean the global namespace 2019-12-06 15:47:39 +01:00
Mark Andrews
fe31fedc31 Merge branch '1401-intermittent-failures-in-the-catz-system-test' into 'master'
Debug "Intermittent failures in the catz system test"

See merge request isc-projects/bind9!2715
2019-12-06 14:16:03 +00:00
Mark Andrews
4dd9ec8919 Increase wait_for_message attempts to 20. 2019-12-06 13:40:46 +00:00
Mark Andrews
1334daaec0 save wait_for_message contents 2019-12-06 13:40:46 +00:00
Michał Kępień
dd6f9391c3 Merge branch '1452-system-test-framework-cleanup-tweaks' into 'master'
System test framework: cleanup tweaks

Closes #1452

See merge request isc-projects/bind9!2717
2019-12-06 13:32:07 +00:00
Michał Kępień
34fb70b17c Merge branch '1452-detect-missing-system-test-results' into 'master'
Detect missing system test results

See merge request isc-projects/bind9!2708
2019-12-06 13:24:26 +00:00