Mark Andrews
9ca6ad6311
Assign fctx->client when fctx is created rather when the join happens.
...
This prevents races on fctx->client whenever a new fetch joins a existing
fetch (by calling fctx_join) as it is now invariant for the active life of
fctx.
2019-12-02 06:01:46 +00:00
Ondřej Surý and Ondřej Surý
edd97cddc1
Refactor dns_name_dup() usage using the semantic patch
2019-11-29 14:00:37 +01:00
Ondřej Surý and Ondřej Surý
a35b19f80e
libdns: dns_name_dup() can't fail, change return type to void
2019-11-29 13:59:40 +01:00
Mark Andrews and Ondřej Surý
637b2c4e51
rdataset_setownercase and rdataset_getownercase need to obtain a node lock
2019-11-28 13:37:56 +01:00
Witold Kręcicki and Ondřej Surý
f01d739968
Use clock_realtime_fast where available
2019-11-28 12:36:55 +01:00
Ondřej Surý
c5b18d3dcb
Use ATOMIC_VAR_INIT to initialize tid_v_base to 0
2019-11-28 12:06:10 +01:00
Ondřej Surý
9e8feec7d3
Improve the atomics usage in isc_counter API
2019-11-28 11:21:52 +01:00
Mark Andrews
8f6aaa7230
add comments 'tree_lock(write) must be held'
2019-11-27 09:58:15 +00:00
Mark Andrews
7cad3b2e91
rbtnode->nsec needs to be read while holding the tree lock
2019-11-27 09:58:15 +00:00
Evan Hunt
715afa9c57
add a stats counter for clients dropped due to recursive-clients limit
2019-11-26 17:55:06 +00:00
Witold Kręcicki
bf2cc19b04
- Access netmgr worker->finished under worker lock only
...
- Join network worker thread to silence tsan
2019-11-26 15:21:25 +01:00
Mark Andrews and Ondřej Surý
f269585de3
provide default yaml indent
2019-11-26 13:52:30 +01:00
Mark Andrews and Ondřej Surý
9936462f31
dns_master_indent and dns_master_indentstr must not be global
...
The indentation for dumping the master zone was driven by two
global variables dns_master_indent and dns_master_indentstr. In
threaded mode, this becomes prone to data access races, so this commit
converts the global variables into a local per-context tuple that
consist of count and string.
2019-11-26 13:52:18 +01:00
Ondřej Surý
21eab267df
Fix missing adb->{e,i}refcnt locking
2019-11-26 13:07:12 +01:00
Witold Kręcicki and Ondřej Surý
bad5a523c2
lib/dns/adb.c: Use atomics for adb quota values and reference counting
2019-11-26 13:07:12 +01:00
Ondřej Surý and Ondřej Surý
b9f4ba19a6
Use integer fast type for mutexatomic shim type
2019-11-26 13:07:12 +01:00
Mark Andrews
26a93d77aa
move maxbuffers test to allocate_udp_buffer
2019-11-25 23:39:45 +00:00
Mark Andrews
011af4de71
Lock dispatch manager buffer_lock before accessing buffers;
...
Only test buffers for UDP dispatches.
2019-11-25 23:39:45 +00:00
Mark Andrews
afc7389ce8
lock disp->mgr before reading disp->mgr->buffers
2019-11-25 23:39:45 +00:00
Ondřej Surý
3ce6708be2
Add missing header guard to new header files
2019-11-25 09:10:29 +01:00
Mark Andrews
6ce39f64d9
remove DNS_RBT_REFLENGTH as it is no longer needed
2019-11-25 16:21:52 +11:00
Mark Andrews
b8bb1e02ad
Split access to wild and dirty from locknum to silence TSAN warnings.
2019-11-25 16:21:52 +11:00
Evan Hunt
00333a5c97
netmgr: add shutdown function
...
- new function isc_nm_shutdown() shuts down all active TCP connections,
but does not destroy the netmgr.
2019-11-22 16:46:32 -08:00
Witold Kręcicki and Evan Hunt
d6c5052f7e
netmgr: actively close all sockets when shutting down server
...
without this change, named could sometimes lag for a while on shutdown
while it waited for open TCP connections to time out.
2019-11-22 16:46:32 -08:00
Witold Kręcicki and Evan Hunt
37354ee225
netmgr: fix TCP backlog and client quota count
...
- add support for TCP backlog, using the value provided by config.
- don't attach to TCP client quota for listening sockets, only
connected sockets.
2019-11-22 16:46:32 -08:00
Evan Hunt
c4ad0466d6
netmgr: log TCP connection errors
2019-11-22 16:46:32 -08:00
Evan Hunt
0260d31d26
netmgr: performance improvement
...
- use memory pools for ievent and uvreq objects.
2019-11-22 16:46:31 -08:00
Evan Hunt
199bd6b623
netmgr: make TCP timeouts configurable
...
- restore support for tcp-initial-timeout, tcp-idle-timeout,
tcp-keepalive-timeout and tcp-advertised-timeout configuration
options, which were ineffective previously.
2019-11-22 16:46:31 -08:00
Witold Kręcicki and Evan Hunt
b7a72b1667
netmgr: TCP improvements
...
- add timeout support for TCP and TCPDNS connections to protect against
slowloris style attacks. currently, all timeouts are hard-coded.
- rework and simplify the TCPDNS state machine.
2019-11-22 16:46:31 -08:00
Mark Andrews
3075445ed6
lock dispatch before reporting state
2019-11-22 19:52:14 +00:00
Mark Andrews
444d742a94
change log category of some messages to DNS_LOGCATEGORY_XFER_IN
2019-11-22 13:14:54 +00:00
Witold Kręcicki
58db2d1d18
Fix a bug in trust anchors verification.
...
We were not reseting the keynode value when iterating over DNSKEYs in
RRSET, so we weren't checking all DNSKEYs against all trust anchors. This
commit fixes the issue by resetting keynode with every loop.
2019-11-21 18:18:56 +01:00
Evan Hunt
7bd3205c61
Merge tag 'v9_15_6' into merge-v9_15_6
2019-11-20 13:34:25 -08:00
Mark Andrews and Ondřej Surý
7d4d64340e
use update_recordsandbytes in rbt_datafixer
2019-11-20 00:17:51 +08:00
Mark Andrews and Ondřej Surý
0cda448248
always obtain write lock when updating version->{records,bytes}
2019-11-20 00:17:51 +08:00
Ondřej Surý and Ondřej Surý
bcfc07e3d3
Fix missing lock around pos and destroy mutex in isc_astack_destroy
2019-11-19 10:31:07 +01:00
Mark Andrews
fcb6dbcdd7
make header->count atomic
2019-11-19 17:29:20 +11:00
Ondřej Surý and Ondřej Surý
a5189eefa5
lib/dns/resolver.c: Call dns_adb_endudpfetch() only for UDP queries
...
The dns_adb_beginudpfetch() is called only for UDP queries, but
the dns_adb_endudpfetch() is called for all queries, including
TCP. This messages the quota counting in adb.c.
2019-11-19 02:53:56 +08:00
Witold Kręcicki and Ondřej Surý
7d93371581
lib/dns/adb.c: don't use more than 64 lock simultaneously when run under TSAN
...
- TSAN can't handle more than 64 locks in one thread, lock ADB bucket-by-bucket
in TSAN mode. This means that the dump won't be consistent but it's good
enough for testing
- Use proper order when unlocking adb->namelocks and adb->entrylocks when
dumping ADB.
2019-11-18 06:51:30 +01:00
Tinderbox User and Evan Hunt
767a2aef43
prep 9.15.6
2019-11-17 18:59:41 -08:00
Evan Hunt
73cafd9d57
clean up comments
2019-11-17 18:59:40 -08:00
Witold Kręcicki and Evan Hunt
70f80a3ec7
fix a problem with the mem_test unit test
...
isc_mem_traceflag_test messes with stdout/stderr, which can cause
problems with subsequent tests (no output, libuv problems). Moving that
test case to the end ensures there are no side effects.
2019-11-17 18:59:40 -08:00
Witold Kręcicki and Evan Hunt
62a8405fa2
netmgr: close uv_loop properly
...
close the uv_handle for the worker async channel, and call
uv_loop_close() on shutdown to ensure that the event loop's
internal resources are properly freed.
2019-11-17 18:59:40 -08:00
Witold Kręcicki and Evan Hunt
6718a4ef8b
ensure isc_queue_t is aligned to double-cacheline size
2019-11-17 18:59:40 -08:00
Evan Hunt
123ee350dc
place a limit on pipelined queries that can be processed simultaneously
...
when the TCPDNS_CLIENTS_PER_CONN limit has been exceeded for a TCP
DNS connection, switch to sequential mode to ensure that memory cannot
be exhausted by too many simultaneous queries.
2019-11-17 18:59:39 -08:00
Evan Hunt
0f9d8eb7b5
add support for DS trust anchors in mirror zone verification
2019-11-17 17:44:17 -08:00
Ondřej Surý and Evan Hunt
e95af30b23
Make lib/ns Thread Sanitizer clean
2019-11-17 17:42:41 -08:00
Ondřej Surý
7b9084d45d
Use atomic_bool for variables shared among threads to make zt_test.c thread-safe
2019-11-18 08:39:12 +08:00
Ondřej Surý
23964dbbbc
Change the shared completion->done variable to atomic_bool in socket_test.c
2019-11-17 09:38:36 +08:00
Mark Andrews and Ondřej Surý
00605058b4
conditionally test based on USE_LIBTOOL or LD_WRAP
2019-11-16 11:46:06 +08:00