Evan Hunt and Witold Kręcicki
3f736b4374
fixup! - Get rid of obsolete fields in ns_client structure - WiP - local address detection - WiP - XFR cancel
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
de05f22fd5
Add retry loop for tests immediately after server restart
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
da5da14f36
fixup! - Get rid of obsolete fields in ns_client structure - WiP - local address detection - WiP - XFR cancel
2019-11-05 12:54:45 +01:00
Witold Kręcicki
d44a0385f8
fixup! - Get rid of obsolete fields in ns_client structure - WiP - local address detection - WiP - XFR cancel
2019-11-05 12:54:45 +01:00
Witold Kręcicki
28f35351ad
- Get rid of obsolete fields in ns_client structure
...
- WiP - local address detection
- WiP - XFR cancel
2019-11-05 12:54:45 +01:00
Witold Kręcicki
39104f766d
Initialize atomics properly in isc_nm_start
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
f78d234ce3
remove isc_nm_paused(), it's no longer needed
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
fb160b071c
fixup! Fix a race between isc_nm_start and nm_thread
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
469e7e5a3e
fixup! fixup! Define a new 'interlocked' status of netmgr - if it's active that means there's an operation that depends on many workers. No two such operation can be launched at once without risking a deadlock, so other ones must either wait or requeue.
2019-11-05 12:54:45 +01:00
Witold Kręcicki
28a0e1e36f
Add tactical post-reload delay to some system tests
2019-11-05 12:54:45 +01:00
Witold Kręcicki
a8fda869a2
fixup! Define a new 'interlocked' status of netmgr - if it's active that means there's an operation that depends on many workers. No two such operation can be launched at once without risking a deadlock, so other ones must either wait or requeue.
2019-11-05 12:54:45 +01:00
Witold Kręcicki
d90aa3a0e1
Disable leak detection in ASAN - libuv has some problems with that
2019-11-05 12:54:45 +01:00
Witold Kręcicki
b29b2bfa2e
Define a new 'interlocked' status of netmgr - if it's active
...
that means there's an operation that depends on many workers.
No two such operation can be launched at once without risking
a deadlock, so other ones must either wait or requeue.
2019-11-05 12:54:45 +01:00
Witold Kręcicki
fdeb8c4f48
fixup! netmgr: don't try to send to a closed tcpdns socket
2019-11-05 12:54:45 +01:00
Witold Kręcicki
e3ab21352a
Fix a race between isc_nm_start and nm_thread
2019-11-05 12:54:45 +01:00
Witold Kręcicki
27593715b3
netmgr: empty the async event queue right before destroying it
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
c32c4c4b3b
silence a clang warning
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
5febb7e002
fixup! - Always close listening sockets asynchronously, even if we're in the specific thread - Export some lib/ns/client stuff for unit tests - Fix lib/ns unit tests
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
97da9703cd
add missing atomic_exchange macro in mutexatomic.h
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
28d4fa2003
fixup! - Always close listening sockets asynchronously, even if we're in the specific thread - Export some lib/ns/client stuff for unit tests - Fix lib/ns unit tests
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
1ac082941c
make library wrapping work correctly in the libns unit tests
...
when LD_WRAP is useable, use it; otherwise, use a "libwrap"
shared library that's linked with '-z interpose' and replaces
isc_nmhandle_unref().
2019-11-05 12:54:45 +01:00
Witold Kręcicki
6dc0edad86
- Free all the pending async calls when the worker is exiting
...
- Add a hack to fix libuv not sending uv_close callback if nothing
was in the workqueue
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
395b9b50a3
re-enqueue stop listening events if network manager is pausing
...
it was still possible to deadlock between stop-listening and pause
events. this is now addressed by testing to see whether the manager is
in the process of pausing, and re-enqueueing stop-listening events
for later. the uv_run() loop is now terminated immediately after
uv_stop() is called, so that the re-enqueued stop-listeneing event
won't be processed until after the manager is unpaused.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
2136e7568e
fixup! - Always close listening sockets asynchronously, even if we're in the specific thread - Export some lib/ns/client stuff for unit tests - Fix lib/ns unit tests
2019-11-05 12:54:45 +01:00
Witold Kręcicki
4e1bdb2e63
- Always close listening sockets asynchronously, even if we're in the specific thread
...
- Export some lib/ns/client stuff for unit tests
- Fix lib/ns unit tests
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
26b9212bff
unlink from recursing-clients and reset state when resuming from recursion
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
4075fb013c
release recursion quota in fetch_callback()
...
this was previously only done in ns_client_endrequest(), which is
called by client_reset_cb() when a client is released. this could
make the system report more recursive clients than were actually
recursing, and caused intermittent test failures in 'fetchlimit'.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
b8e54a6ca4
don't assert in isc_task_pause() if the task is 'running'
...
there is a window of time after a task finishes running an event
before the task state is reset from 'running' to 'ready' or 'idle'.
previously, if the network manager ran ns__client_request() during
that time, isc_task_pause() would assert.
2019-11-05 12:54:45 +01:00
Witold Kręcicki
d395a23335
fixup! Add atomic_exchange operations to stdatomics.h
2019-11-05 12:54:45 +01:00
Witold Kręcicki
26b19951ab
fixup! Add atomic_exchange operations to stdatomics.h
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
026efd2cc8
fully reset the client object before reusing it
...
not doing so caused unpredictable failures, for example, when
client->rcode_override was set by a previous query and then the
client was reused.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
549c3a0111
use family AF_INET6 when creating UDP sockets for IPv6 addresses
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
31fe4bbe7c
lock manager when stopping workers, to prevent a possible shutdown deadlock
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
a0410678de
Don't assert if there's left-over data after reading a DNS TCP message.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
6900793dba
set the base pointer correctly when gluing TCP reads into a single message
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
638a289ca9
Implement "maxudp" for netmgr so that the legacy test will pass.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
1102ec73a7
remove obsolete references to '-T clienttest'
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
67211aa288
acquire manager lock before sending 'stoplisten' events to workers
...
this prevents a potential race between isc_nm_udp_stoplistening()
and isc_nm_pause() which could cause a server to deadlock.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
7bc1004f00
always reference the client->handle before ns_query_recurse()
...
this supercedes the experiment in commit eab6c2bff
("attach to nmhandle during zerottl refetch"), and ensures that
the client can't be reset before fetch_callback() is reached.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
44e7fec8a7
make "stoplisten" events asynchronous so we can issue them while paused
...
when reconfiguring a server we're in task exclusive mode, which
means the netmgr is paused. previously, when we issued "stoplistening"
events, we would wait for the worker thread to process the event
before proceeding. since that can't happen while paused, we could
hit a deadlock during reconfig if the listen-on addresses changed.
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
a5ca545f39
more fixes for handle reference counting
...
- ref handle in tcp_send_direct and tcp_send_cb
- unref handle when xfrout fails
- remove some unneeded unrefs in ns__client_request
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
0e2154f980
style nits
2019-11-05 12:54:45 +01:00
Witold Kręcicki
7a677338ec
Fix compilation issues in mutexatomics mode
2019-11-05 12:54:45 +01:00
Witold Kręcicki
334d9aa90b
Use pkg-config to detect libuv
2019-11-05 12:54:45 +01:00
Witold Kręcicki
3584565c4b
netmgr: fixes for Windows:
...
- MSVC doesn't like empty {} initializers
- Emulate stdalign.h on Windows with __declspec(align())
- There's no usleep on Windows
- Add missing symbols to libns.def and libisc.def
- Proper use of SO_REUSE****
- libuv detection in Configure
- Minor fixes to the atomics code
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
1b4bbebd11
eliminate isc_nm_shutdown in favor of isc_nm_detach
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
e457feb1e3
continue client/handle reference counting changes
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
021848bca9
experiment: eliminate client reference counting; use nmhandler only
2019-11-05 12:54:45 +01:00
Evan Hunt and Witold Kręcicki
669f659fe3
partial fix: improve socket and metmgr cleanup for orderly shudown
...
- when we attempt to shut down a parent socket, but its children
still have active handles, the destruction is delayed, and previously
it was never resumed. now, when the last handle for a child socket is
detached, we check again whether the parent can be destroyed.
- the netmgr is not shut down until all references to it are detached.
2019-11-05 12:54:45 +01:00
Witold Kręcicki
e3b597ffa7
Add atomic_exchange operations to stdatomics.h
2019-11-05 12:54:45 +01:00