]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
4 years agoWIP: non-blocking zone lookup each-requeue-auth-query
Evan Hunt [Fri, 4 Jun 2021 02:35:01 +0000 (19:35 -0700)] 
WIP: non-blocking zone lookup

- add a DNS_DBFIND_NONBLOCK option, which causes dns_db_find/findext()
  to return ISC_R_LOCKBUSY if unable to acquire a read lock on the
  database.
- use the asynchronous hook mechanism to postpone query_lookup() if
  this occurs.

4 years agoMerge branch '2751-serve-stale-tests-false-negative' into 'main'
Mark Andrews [Thu, 3 Jun 2021 08:40:38 +0000 (08:40 +0000)] 
Merge branch '2751-serve-stale-tests-false-negative' into 'main'

Resolve "serve-stale tests false negative"

Closes #2751

See merge request isc-projects/bind9!5143

4 years agoAddress test race condition in serve-stale
Mark Andrews [Thu, 3 Jun 2021 05:42:15 +0000 (15:42 +1000)] 
Address test race condition in serve-stale

the dig.out.test# files could still be being written when the
content greps where being made.

4 years agoMerge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into...
Mark Andrews [Thu, 3 Jun 2021 07:31:26 +0000 (07:31 +0000)] 
Merge branch '2750-provide-more-insight-into-why-the-timer_test-is-failing' into 'main'

Resolve "Provide more insight into why the timer_test is failing."

Closes #2750

See merge request isc-projects/bind9!5142

4 years agoReport which assertion failed when calling set_global_error
Mark Andrews [Thu, 3 Jun 2021 01:55:31 +0000 (11:55 +1000)] 
Report which assertion failed when calling set_global_error

4 years agoMerge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'
Mark Andrews [Wed, 2 Jun 2021 22:37:10 +0000 (22:37 +0000)] 
Merge branch '2724-statschannel-system-test-sometimes-hangs' into 'main'

Resolve "statschannel system test sometimes hangs"

Closes #2724

See merge request isc-projects/bind9!5123

4 years agoAdd timeout to url get requests
Mark Andrews [Wed, 2 Jun 2021 06:40:58 +0000 (16:40 +1000)] 
Add timeout to url get requests

to prevent the system test taking forever on failures.

4 years agoMerge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 16:09:48 +0000 (16:09 +0000)] 
Merge branch '2746-fix-the-typo-in-setsockopt_off' into 'main'

Fix copy&paste error in setsockopt_off

Closes #2746

See merge request isc-projects/bind9!5138

4 years agoAdd CHANGES and release note for [GL #2746]
Ondřej Surý [Wed, 2 Jun 2021 15:44:16 +0000 (17:44 +0200)] 
Add CHANGES and release note for [GL #2746]

4 years agoFix copy&paste error in setsockopt_off
Ondřej Surý [Wed, 2 Jun 2021 15:41:17 +0000 (17:41 +0200)] 
Fix copy&paste error in setsockopt_off

Because of copy&paste error the setsockopt_off macro would enable
the socket option instead of disabling it.

4 years agoMerge branch '2540-check-dname-resolution-via-itself' into 'main'
Michał Kępień [Wed, 2 Jun 2021 12:49:05 +0000 (12:49 +0000)] 
Merge branch '2540-check-dname-resolution-via-itself' into 'main'

Check DNAME resolution via itself

Closes #2540

See merge request isc-projects/bind9!5135

4 years agoCheck DNAME resolution via itself
Mark Andrews [Mon, 1 Mar 2021 05:38:36 +0000 (16:38 +1100)] 
Check DNAME resolution via itself

4 years agoMerge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'
Michał Kępień [Wed, 2 Jun 2021 11:35:55 +0000 (11:35 +0000)] 
Merge branch '2467-add-a-system-test-checking-a-malformed-ixfr' into 'main'

Add a system test checking a malformed IXFR

Closes #2467

See merge request isc-projects/bind9!5132

4 years agoAdd a system test checking a malformed IXFR
Mark Andrews [Wed, 3 Feb 2021 00:10:20 +0000 (11:10 +1100)] 
Add a system test checking a malformed IXFR

Make sure an incoming IXFR containing an SOA record which is not placed
at the apex of the transferred zone does not result in a broken version
of the zone being served by named and/or a subsequent crash.

4 years agoMerge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 09:56:20 +0000 (09:56 +0000)] 
Merge branch 'ondrej/fix-uv_udp_connect-detection' into 'main'

Cleanup the remaining of HAVE_UV_<func> macros

See merge request isc-projects/bind9!5127

4 years agoCleanup the remaining of HAVE_UV_<func> macros
Ondřej Surý [Wed, 2 Jun 2021 09:23:36 +0000 (11:23 +0200)] 
Cleanup the remaining of HAVE_UV_<func> macros

While cleaning up the usage of HAVE_UV_<func> macros, we forgot to
cleanup the HAVE_UV_UDP_CONNECT in the actual code and
HAVE_UV_TRANSLATE_SYS_ERROR and this was causing Windows build to fail
on uv_udp_send() because the socket was already connected and we were
falsely assuming that it was not.

The platforms with autoconf support were not affected, because we were
still checking for the functions from the configure.

4 years agoMerge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'
Ondřej Surý [Wed, 2 Jun 2021 07:35:39 +0000 (07:35 +0000)] 
Merge branch 'ondrej/add-libnghttp2-dev-to-lgtm.yml' into 'main'

Add libnghttp2-dev to .lgtm.yml

See merge request isc-projects/bind9!5125

4 years agoAdd libnghttp2-dev to .lgtm.yml
Ondřej Surý [Wed, 2 Jun 2021 07:33:27 +0000 (09:33 +0200)] 
Add libnghttp2-dev to .lgtm.yml

The LGTM.com configuration was missing required library, so the
"Extraction" step of the analysis was failing.

4 years agoMerge branch 'artem-http-write-buffering' into 'main'
Artem Boldariev [Tue, 1 Jun 2021 18:28:34 +0000 (18:28 +0000)] 
Merge branch 'artem-http-write-buffering' into 'main'

HTTP/2 write buffering

See merge request isc-projects/bind9!5121

4 years agoHTTP/2 write buffering
Artem Boldariev [Mon, 24 May 2021 11:14:17 +0000 (14:14 +0300)] 
HTTP/2 write buffering

This commit adds the ability to consolidate HTTP/2 write requests if
there is already one in flight. If it is the case, the code will
consolidate multiple subsequent write request into a larger one
allowing to utilise the network in a more efficient way by creating
larger TCP packets as well as by reducing TLS records overhead (by
creating large TLS records instead of multiple small ones).

This optimisation is especially efficient for clients, creating many
concurrent HTTP/2 streams over a transport connection at once.  This
way, the code might create a small amount of multi-kilobyte requests
instead of many 50-120 byte ones.

In fact, it turned out to work so well that I had to add a work-around
to the code to ensure compatibility with the flamethrower, which, at
the time of writing, does not support TLS records larger than two
kilobytes. Now the code tries to flush the write buffer after 1.5
kilobyte, which is still pretty adequate for our use case.

Essentially, this commit implements a recommendation given by nghttp2
library:

https://nghttp2.org/documentation/nghttp2_session_mem_send.html

4 years agoMerge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'
Ondřej Surý [Mon, 31 May 2021 13:51:48 +0000 (13:51 +0000)] 
Merge branch '2732-zone-dumping-is-blocking-the-networking-io' into 'main'

Improve the zone dumping impact on the networking

Closes #2732

See merge request isc-projects/bind9!5107

4 years agoAdd CHANGES and release note for [GL #2732]
Ondřej Surý [Thu, 27 May 2021 08:34:57 +0000 (10:34 +0200)] 
Add CHANGES and release note for [GL #2732]

4 years agoIndicate to the kernel that we won't be needing the zone dumps
Ondřej Surý [Thu, 27 May 2021 09:04:37 +0000 (11:04 +0200)] 
Indicate to the kernel that we won't be needing the zone dumps

Add a call to posix_fadvise() to indicate to the kernel, that `named`
won't be needing the dumped zone files any time soon with:

 * POSIX_FADV_DONTNEED - The specified data will not be accessed in the
   near future.

Notes:

 POSIX_FADV_DONTNEED attempts to free cached pages associated with the
 specified region. This is useful, for example, while streaming large
 files. A program may periodically request the kernel to free cached
 data that has already been used, so that more useful cached pages are
 not discarded instead.

4 years agoRefactor zone dumping code to use netmgr async threadpools
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Refactor zone dumping code to use netmgr async threadpools

Previously, dumping the zones to the files were quantized, so it doesn't
slow down network IO processing.  With the introduction of network
manager asynchronous threadpools, we can move the IO intensive work to
use that API and we don't have to quantize the work anymore as it the
file IO won't block anything except other zone dumping processes.

4 years agoAdd isc_task_getnetmgr() function
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Add isc_task_getnetmgr() function

Add a function to pull the attached netmgr from inside the executed
task.  This is needed for any task that needs to call the netmgr API.

4 years agoAdd asynchronous work API to the network manager
Ondřej Surý [Thu, 27 May 2021 07:45:07 +0000 (09:45 +0200)] 
Add asynchronous work API to the network manager

The libuv has a support for running long running tasks in the dedicated
threadpools, so it doesn't affect networking IO.

This commit adds isc_nm_work_enqueue() wrapper that would wraps around
the libuv API and runs it on top of associated worker loop.

The only limitation is that the function must be called from inside
network manager thread, so the call to the function should be wrapped
inside a (bound) task.

4 years agoUse UV_VERSION_HEX to decide whether we need libuv shim functions
Ondřej Surý [Thu, 27 May 2021 11:38:21 +0000 (13:38 +0200)] 
Use UV_VERSION_HEX to decide whether we need libuv shim functions

Instead of having a configure check for every missing function that has
been added in later version of libuv, we now use UV_VERSION_HEX to
decide whether we need the shim or not.

4 years agoAdd uv_os_getenv() and uv_os_setenv() compatibility shims
Ondřej Surý [Thu, 27 May 2021 10:34:06 +0000 (12:34 +0200)] 
Add uv_os_getenv() and uv_os_setenv() compatibility shims

The uv_os_getenv() and uv_os_setenv() functions were introduced in the
libuv >= 1.12.0.  Add simple compatibility shims for older versions.

4 years agoAdd uv_req_get_data() and uv_req_set_data() compatibility shims
Ondřej Surý [Thu, 27 May 2021 09:46:38 +0000 (11:46 +0200)] 
Add uv_req_get_data() and uv_req_set_data() compatibility shims

The uv_req_get_data() and uv_req_set_data() functions were introduced in
libuv >= 1.19.0, so we need to add compatibility shims with older libuv
versions.

4 years agoCleanup the uv_import check
Ondřej Surý [Thu, 27 May 2021 11:05:46 +0000 (13:05 +0200)] 
Cleanup the uv_import check

The uv_import() is not needed anymore, so we can remove the autoconf
check for it.

4 years agoMerge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'
Michał Kępień [Mon, 31 May 2021 12:34:45 +0000 (12:34 +0000)] 
Merge branch 'michal/regenerate-man-pages-with-docutils-0.16' into 'main'

Regenerate man pages with docutils 0.16

See merge request isc-projects/bind9!5119

4 years agoRegenerate man pages with docutils 0.16
Michał Kępień [Mon, 31 May 2021 09:22:52 +0000 (11:22 +0200)] 
Regenerate man pages with docutils 0.16

Commit bdb777b2a2e079ce25f567a316e74436f0584029 updated the man pages
to contents produced using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.17.1

However, sphinx-rtd-theme 0.5.2 is incompatible with versions 0.17+ of
the docutils package.  This problem was addressed in the Docker image
used for building man pages by downgrading the docutils package to
version 0.16.

Regenerate the man pages again, this time using:

  - Sphinx 4.0.2
  - sphinx-rtd-theme 0.5.2
  - docutils 0.16

This is necessary to prevent the "docs" GitLab CI job from failing.

4 years agoMerge branch 'kchen-servestale-fix' into 'main'
Evan Hunt [Sun, 30 May 2021 19:28:59 +0000 (19:28 +0000)] 
Merge branch 'kchen-servestale-fix' into 'main'

Several serve-stale fixes

See merge request isc-projects/bind9!199

4 years agoReuse rdatset->ttl when dumping ancient RRsets
Matthijs Mekking [Thu, 27 May 2021 07:43:21 +0000 (09:43 +0200)] 
Reuse rdatset->ttl when dumping ancient RRsets

Rather than having an expensive 'expired' (fka 'stale_ttl') in the
rdataset structure, that is only used to be printed in a comment on
ancient RRsets, reuse the TTL field of the RRset.

4 years agoSeveral serve-stale improvements
Kevin Chen [Thu, 11 Mar 2021 14:45:44 +0000 (15:45 +0100)] 
Several serve-stale improvements

Commit a83c8cb0afd88d54b9cf67239f2495c9b0391e97 updated masterdump so
that stale records in "rndc dumpdb" output no longer shows 0 TTLs.  In
this commit we change the name of the `rdataset->stale_ttl` field to
`rdataset->expired` to make its purpose clearer, and set it to zero in
cases where it's unused.

Add 'rbtdb->serve_stale_ttl' to various checks so that stale records
are not purged from the cache when they've been stale for RBTDB_VIRTUAL
(300) seconds.

Increment 'ns_statscounter_usedstale' when a stale answer is used.

Note: There was a question of whether 'overmem_purge' should be
purging ancient records, instead of stale ones.  It is left as purging
stale records, since stale records could take up the majority of the
cache.

This submission is copyrighted Akamai Technologies, Inc. and provided
under an MPL 2.0 license.

This commit was originally authored by Kevin Chen, and was updated by
Matthijs Mekking to match recent serve-stale developments.

4 years agoMerge branch '2733-serve-stale-prefetch-crash' into 'main'
Evan Hunt [Sun, 30 May 2021 07:31:38 +0000 (07:31 +0000)] 
Merge branch '2733-serve-stale-prefetch-crash' into 'main'

Fix crash with serve-stale in combination with prefetch

Closes #2733

See merge request isc-projects/bind9!5111

4 years agoAdd CHANGES and notes for [#2733]
Matthijs Mekking [Thu, 27 May 2021 14:04:07 +0000 (16:04 +0200)] 
Add CHANGES and notes for [#2733]

4 years agoadd a system test for the prefetch bug
Evan Hunt [Fri, 28 May 2021 02:55:12 +0000 (19:55 -0700)] 
add a system test for the prefetch bug

Ensure that if prefetch is triggered as a result of a query
restart, it won't have the TRYSTALE_ONTIMEOUT flag set.

4 years agoReset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume
Matthijs Mekking [Thu, 27 May 2021 13:54:13 +0000 (15:54 +0200)] 
Reset DNS_FETCHOPT_TRYSTALE_ONTIMEOUT on resume

Once we resume a query, we should clear DNS_FETCHOPT_TRYSTALE_ONTIMEOUT
from the options to prevent triggering the stale-answer-client-timeout
on subsequent fetches.

If we don't this may cause a crash when for example when prefetch is
triggered after a query restart.

4 years agoMerge branch 'mnowak/add-fedora-34' into 'main'
Michal Nowak [Fri, 28 May 2021 10:50:51 +0000 (10:50 +0000)] 
Merge branch 'mnowak/add-fedora-34' into 'main'

Add Fedora 34

See merge request isc-projects/bind9!5075

4 years agoAdd Fedora 34
Michal Nowak [Thu, 20 May 2021 12:40:47 +0000 (14:40 +0200)] 
Add Fedora 34

4 years agoMerge branch '2731-servestale-dns64' into 'main'
Evan Hunt [Thu, 27 May 2021 18:52:31 +0000 (18:52 +0000)] 
Merge branch '2731-servestale-dns64' into 'main'

fix a crash when using stale data with dns64

Closes #2731

See merge request isc-projects/bind9!5102

4 years agoCHANGES, release note
Evan Hunt [Thu, 27 May 2021 00:41:11 +0000 (17:41 -0700)] 
CHANGES, release note

4 years agoTest with stale timeout cache miss, then fetch completes
Matthijs Mekking [Thu, 27 May 2021 13:44:09 +0000 (15:44 +0200)] 
Test with stale timeout cache miss, then fetch completes

Add a test case where a client request is received and the stale
timeout occurs, but it is not served stale data because there is no entry
in the cache, then is served an authoritative answer once the background
fetch completes. This ensures that a stale timeout only affects a
subsequent response if the client was answered.

4 years agoclean up query correctly if already answered by serve-stale
Evan Hunt [Wed, 26 May 2021 22:35:18 +0000 (15:35 -0700)] 
clean up query correctly if already answered by serve-stale

when a serve-stale answer has been sent, the client continues waiting
for a proper answer. if a final completion event for the client does
arrive, it can just be cleaned up without sending a response, similar
to a canceled fetch.

4 years agoadd a test of DNS64 processing with a stale negative response
Evan Hunt [Wed, 26 May 2021 21:10:50 +0000 (14:10 -0700)] 
add a test of DNS64 processing with a stale negative response

- send a query for an AAAA which will be resolved as a mapped A
- disable authoritative responses
- wait for the negative AAAA response to become stale
- send another query, wait for the stale answer
- re-enable authorative responses so that a real answer arrives
- currently, this triggers an assertion in query.c

4 years agoMerge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'
Ondřej Surý [Thu, 27 May 2021 06:22:14 +0000 (06:22 +0000)] 
Merge branch '2708-named-doesn-t-compile-with-gcc-10' into 'main'

Resolve "named doesn't compile with GCC 10."

Closes #2708

See merge request isc-projects/bind9!5057

4 years agoRemove priority from attribute constructor/destructor
Mark Andrews [Wed, 19 May 2021 06:38:33 +0000 (16:38 +1000)] 
Remove priority from attribute constructor/destructor

On some platforms, the __attribute__ constructor and destructor won't
take priorities and the compilation failed.  On such platform would be
macOS.  For this reason, the constructor/destructor in the libisc was
reworked to not use priorities, but have a single constructor and
destructor that calls the appropriate routines in correct order.

This commit removes the extra priority because it's now not needed and
it also breaks a compilation on macOS with GCC 10.

4 years agoMerge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent...
Mark Andrews [Thu, 27 May 2021 02:56:57 +0000 (02:56 +0000)] 
Merge branch '2282-shutdown-system-test-needs-to-be-tweaked-to-account-for-recent-netmgr-changes' into 'main'

Resolve ""shutdown" system test needs to be tweaked to account for recent netmgr changes"

Closes #2282

See merge request isc-projects/bind9!4923

4 years agoHandling NoNameservers exception
Diego Fronza [Tue, 20 Apr 2021 15:59:46 +0000 (12:59 -0300)] 
Handling NoNameservers exception

In the shutdown system test multiple queries are sent to a resolver
instance, in the meantime we terminate the same resolver process for
which the queries were sent to, either via rndc stop or a SIGTERM
signal, that means the resolver may not be able to answer all those
queries, since it has initiated the shutdown process.

The dnspython library raises a dns.resolver.NoNameservers exception when
a resolver object fails to receive an answer from the specified list
of nameservers (resolver.nameservers list), we need to handle this
exception as this is something that may happen since we asked the
resolver to terminate, as a result it may not answer clients even if
an answer is available, as the operation will be canceled.

4 years agoMerge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'
Ondřej Surý [Wed, 26 May 2021 14:24:58 +0000 (14:24 +0000)] 
Merge branch 'ondrej/revert-OpenBSD-system-wide-connection-timeout' into 'main'

Revert "Configure the system-wide TCP connection timeout on OpenBSD"

See merge request isc-projects/bind9!5100

4 years agoRevert "Configure the system-wide TCP connection timeout on OpenBSD"
Ondřej Surý [Wed, 26 May 2021 14:16:00 +0000 (16:16 +0200)] 
Revert "Configure the system-wide TCP connection timeout on OpenBSD"

This reverts commit 8ff15fc0289e7eba5862ae5aca611fa1d327dde5.

4 years agoMerge branch 'marka-missing-initialisations' into 'main'
Mark Andrews [Wed, 26 May 2021 08:52:46 +0000 (08:52 +0000)] 
Merge branch 'marka-missing-initialisations' into 'main'

Add missing initialisations

See merge request isc-projects/bind9!5097

4 years agoAdd missing initialisations
Mark Andrews [Wed, 26 May 2021 07:55:43 +0000 (17:55 +1000)] 
Add missing initialisations

configuring with --enable-mutex-atomics flagged these incorrectly
initialised variables on systems where pthread_mutex_init doesn't
just zero out the structure.

4 years agoMerge branch '2722-bad-sizeof-declaration-in-main' into 'main'
Ondřej Surý [Wed, 26 May 2021 08:10:45 +0000 (08:10 +0000)] 
Merge branch '2722-bad-sizeof-declaration-in-main' into 'main'

Fix the sizeof() for array holding the pointers to clientmgr

Closes #2722

See merge request isc-projects/bind9!5098

4 years agoFix the sizeof() for array holding the pointers to clientmgr
Ondřej Surý [Wed, 26 May 2021 08:01:30 +0000 (10:01 +0200)] 
Fix the sizeof() for array holding the pointers to clientmgr

The size of the array holding the pointers to clientmgr was created so
big it could hold the actual clientmgr objects, not just the pointer.
This commit fixes the size to be just the ncpus * sizeof(pointer).

4 years agoMerge branch '2721-shutdown-race-in-interfacemgr-cleanup' into 'main'
Ondřej Surý [Wed, 26 May 2021 08:00:25 +0000 (08:00 +0000)] 
Merge branch '2721-shutdown-race-in-interfacemgr-cleanup' into 'main'

Cleanup the struct isc_nmiface

Closes #2721

See merge request isc-projects/bind9!5096

4 years agoCleanup the struct isc_nmiface
Ondřej Surý [Wed, 26 May 2021 07:55:10 +0000 (09:55 +0200)] 
Cleanup the struct isc_nmiface

In previous MR, I forgot to remove the `struct isc_nmiface`, this commit
rectifies that.

4 years agoMerge branch '2721-shutdown-race-in-interfacemgr' into 'main'
Ondřej Surý [Wed, 26 May 2021 07:48:00 +0000 (07:48 +0000)] 
Merge branch '2721-shutdown-race-in-interfacemgr' into 'main'

Make a local copy of interface address when creating new socket

Closes #2721

See merge request isc-projects/bind9!5094

4 years agoRefactor the interface handling in the netmgr
Ondřej Surý [Wed, 26 May 2021 06:15:34 +0000 (08:15 +0200)] 
Refactor the interface handling in the netmgr

The isc_nmiface_t type was holding just a single isc_sockaddr_t,
so we got rid of the datatype and use plain isc_sockaddr_t in place
where isc_nmiface_t was used before.  This means less type-casting and
shorter path to access isc_sockaddr_t members.

At the same time, instead of keeping the reference to the isc_sockaddr_t
that was passed to us when we start listening, we will keep a local
copy. This prevents the data race on destruction of the ns_interface_t
objects where pending nmsockets could reference the sockaddr of already
destroyed ns_interface_t object.

4 years agoMerge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on...
Mark Andrews [Tue, 25 May 2021 22:46:52 +0000 (22:46 +0000)] 
Merge branch '2685-max-ixfr-ratio-appears-to-be-forcing-axfr-very-prematurely-on-bind-9-16-15' into 'main'

Resolve "max-ixfr-ratio appears to be forcing AXFR very prematurely on BIND 9.16.15"

Closes #2685

See merge request isc-projects/bind9!5011

4 years agoAdd release note for [GL #2685]
Mark Andrews [Fri, 14 May 2021 01:15:30 +0000 (11:15 +1000)] 
Add release note for [GL #2685]

4 years agoAdd CHANGES note for [GL #2685]
Mark Andrews [Tue, 11 May 2021 07:06:06 +0000 (17:06 +1000)] 
Add CHANGES note for [GL #2685]

4 years agoConsolidate xhdr fixups
Mark Andrews [Thu, 13 May 2021 05:44:02 +0000 (15:44 +1000)] 
Consolidate xhdr fixups

4 years agoCheck that IXFR delta size is correct
Mark Andrews [Wed, 12 May 2021 07:13:21 +0000 (17:13 +1000)] 
Check that IXFR delta size is correct

4 years agoCorrect size calculation in dns_journal_iter_init()
Mark Andrews [Tue, 11 May 2021 06:39:41 +0000 (16:39 +1000)] 
Correct size calculation in dns_journal_iter_init()

* dns_journal_next() leaves the read point in the journal after the
transaction header so journal_seek() should be inside the loop.
* we need to recover from transaction header inconsistencies

Additionally when correcting for <size, serial0, serial1, 0> the
correct consistency check is isc_serial_gt() rather than
isc_serial_ge().  All instances updated.

4 years agoMerge branch '2629-man-pages-aren-t-installed-when-building-9-17-x' into 'main'
Michal Nowak [Tue, 25 May 2021 09:34:11 +0000 (09:34 +0000)] 
Merge branch '2629-man-pages-aren-t-installed-when-building-9-17-x' into 'main'

Install man pages when sphinx-build tool is missing

Closes #2629

See merge request isc-projects/bind9!4945

4 years agoInstall BIND with "make DESTDIR=<PATH> install"
Michal Nowak [Tue, 13 Apr 2021 16:58:22 +0000 (18:58 +0200)] 
Install BIND with "make DESTDIR=<PATH> install"

BIND installation should be done by setting DESTDIR during "make
install" not by setting prefix via ./configure.

Make sure that installation with DESTDIR=<PATH> works by checking that
named binary and it's respective man page were installed and that
well-known BIND9 directories - and only them - are present in DESTDIR.

Also rename install path variable from BIND_INSTALL_PATH to
INSTALL_PATH to avoid namespace clash in stress tests which use
BIND_INSTALL_PATH variable to configure path to BIND9 binaries.

4 years agoInstall man pages when sphinx-build tool is missing
Michal Nowak [Tue, 13 Apr 2021 16:26:24 +0000 (18:26 +0200)] 
Install man pages when sphinx-build tool is missing

The exclusion of doc/man/ when the sphinx-build tool is missing was
excessive as some targets in doc/man/ are necessary to install man
pages.

4 years agoMerge branch 'ondrej/dont-set-mctx-name-in-resolver' into 'main'
Ondřej Surý [Tue, 25 May 2021 05:27:59 +0000 (05:27 +0000)] 
Merge branch 'ondrej/dont-set-mctx-name-in-resolver' into 'main'

Don't set memory context name in resolver.c

See merge request isc-projects/bind9!5090

4 years agoDon't set memory context name in resolver.c
Ondřej Surý [Tue, 25 May 2021 05:25:44 +0000 (07:25 +0200)] 
Don't set memory context name in resolver.c

We now attach to existing memory context instead of creating a new
memory context, so we should not set its name.

4 years agoMerge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic' into 'main'
Ondřej Surý [Mon, 24 May 2021 19:43:15 +0000 (19:43 +0000)] 
Merge branch 'ondrej/replace-ubuntu-xenial-with-ubuntu-bionic' into 'main'

Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI

See merge request isc-projects/bind9!4800

4 years agoReplace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI
Ondřej Surý [Fri, 12 Mar 2021 13:02:57 +0000 (14:02 +0100)] 
Replace Ubuntu 16.04 LTS with Ubuntu 18.04 LTS in the GitLab CI

Ubuntu 16.04 (Xenial Xerus) is reaching End of Standard Support in April
2021 thus we are removing it from the list of supported platforms and
replacing it with Ubuntu 18.04 LTS (Bionic Beaver).

4 years agoMerge branch '2433-reduce-clientmgr-memory-contexts-and-tasks' into 'main'
Ondřej Surý [Mon, 24 May 2021 19:20:15 +0000 (19:20 +0000)] 
Merge branch '2433-reduce-clientmgr-memory-contexts-and-tasks' into 'main'

Reduce the number of clientmgr objects created

Closes #2433

See merge request isc-projects/bind9!5085

4 years agoAdd CHANGES and release note for GL #2433
Ondřej Surý [Mon, 24 May 2021 12:47:11 +0000 (14:47 +0200)] 
Add CHANGES and release note for GL #2433

4 years agoAdjust the fillcount and freemax for dns_message mempools
Ondřej Surý [Sun, 23 May 2021 13:36:06 +0000 (15:36 +0200)] 
Adjust the fillcount and freemax for dns_message mempools

According to the measurements (recorded on GL!5085), the fillcount of 2
for namepool and fillcount of 4 for rdspool can fit 99.99% of request
for tested scenarios.

This was discovered by perf recording the single second recursive test
using flamethrower where the initial malloc lit up like a flare.

4 years agoReduce the number of clientmgr objects created
Ondřej Surý [Sat, 22 May 2021 16:12:11 +0000 (18:12 +0200)] 
Reduce the number of clientmgr objects created

Previously, as a way of reducing the contention between threads a
clientmgr object would be created for each interface/IP address.

We tasks being more strictly bound to netmgr workers, this is no longer
needed and we can just create clientmgr object per worker queue (ncpus).

Each clientmgr object than would have a single task and single memory
context.

4 years agoDon't create per bucket memory contexts in resolver
Ondřej Surý [Tue, 11 May 2021 10:09:15 +0000 (12:09 +0200)] 
Don't create per bucket memory contexts in resolver

Similarly, the resolver code would create hundreds of memory contexts
just on the resolver setup.  The contention will be reduced directly in
the allocator, so for now just attach to the view memory instead of
creating separate memory context for each bucket.

4 years agoRun shutdown events with the task's existing threadid
Ondřej Surý [Wed, 19 May 2021 06:27:16 +0000 (08:27 +0200)] 
Run shutdown events with the task's existing threadid

Previously, task->threadid was reassigned to 0 while shutting
down, which caused an assertion.

4 years agoReduce the number of client tasks and bind them to netmgr queues
Ondřej Surý [Tue, 18 May 2021 17:44:31 +0000 (19:44 +0200)] 
Reduce the number of client tasks and bind them to netmgr queues

Since a client object is bound to a netmgr handle, each client
will always be processed by the same netmgr worker, so we can
simplify the code by binding client->task to the same thread as
the client. Since ns__client_request() now runs in the same event
loop as client->task events, is no longer necessary to pause the
task manager before launching them.

Also removed some functions in isc_task that were not used.

4 years agoReduce the number of tasks in the clientmgr
Ondřej Surý [Thu, 13 May 2021 06:40:33 +0000 (08:40 +0200)] 
Reduce the number of tasks in the clientmgr

We now use one task per CPU per dispatchmgr (that's still a lot).

4 years agoReduce the number of mctx created in clientmgr
Ondřej Surý [Tue, 11 May 2021 10:03:11 +0000 (12:03 +0200)] 
Reduce the number of mctx created in clientmgr

The number of memory contexts created in the clientmgr was enormous.  It
could easily create thousands of memory contexts because the formula was:

    nprotocols * ncpus * ninterfaces * CLIENT_NMCTXS_PERCPU (8)

The original goal was to reduce the contention when allocating the
memory, but after a while nobody noticed that the amount of memory
context allocated would not reduce contention at all.

This commit removes the whole mctxpool and just uses the mctx from
clientmgr as the contention will be reduced directly in the allocator.

4 years agoMerge branch 'mnowak/freebsd-13' into 'main'
Michal Nowak [Mon, 24 May 2021 16:15:35 +0000 (16:15 +0000)] 
Merge branch 'mnowak/freebsd-13' into 'main'

Add FreeBSD 13.0

See merge request isc-projects/bind9!4814

4 years agoRun gcc:tarball CI job for merge requests
Michal Nowak [Thu, 20 May 2021 16:00:28 +0000 (18:00 +0200)] 
Run gcc:tarball CI job for merge requests

Running gcc:tarball CI job for merge requests is consistent with how we
run gcc:out-of-tree CI job and should help identify problems with the
build system during the review process, not once merged during daily
runs. For the sake of time, unit and system tests associated with the
gcc:tarball CI job are excluded from merge requests.

4 years agoDo not spawn FreeBSD 11 CI jobs in merge requests
Michal Nowak [Thu, 20 May 2021 09:06:48 +0000 (11:06 +0200)] 
Do not spawn FreeBSD 11 CI jobs in merge requests

4 years agoCreate an anchor for schedules, tags, and web rules
Michal Nowak [Thu, 20 May 2021 08:56:12 +0000 (10:56 +0200)] 
Create an anchor for schedules, tags, and web rules

It's a common pattern to spawn CI jobs only for pipelines triggered by
schedules, tags, and web. There should be an anchor so that the rules
are not repeated.

4 years agoAdd FreeBSD 13.0
Michal Nowak [Wed, 17 Mar 2021 16:19:47 +0000 (17:19 +0100)] 
Add FreeBSD 13.0

4 years agoMerge branch '2643-fix-rndc-timeout' into 'main'
Ondřej Surý [Sat, 22 May 2021 09:46:27 +0000 (09:46 +0000)] 
Merge branch '2643-fix-rndc-timeout' into 'main'

extend rndc timeout to 60 seconds

Closes #2643

See merge request isc-projects/bind9!5082

4 years agoextend rndc timeout to 60 seconds
Evan Hunt [Sat, 22 May 2021 02:33:54 +0000 (19:33 -0700)] 
extend rndc timeout to 60 seconds

the idle timeout for rndc connections was set to 10 seconds, but this
caused intermittent system failures of the 'rndc' system test on slow
platforms, since 'rndc reconfig' could time out before reconfiguration
was complete.

this commit restores the original timeout value of 60 seconds, which was
changed inadvertently after rndc was updated to use the network manager.

even with this change, however, the test can still time out under
TSAN because loading the huge zone can take a very long time (upwards
of two minutes). so the test is modified here to generate a smaller zone
file when running under TSAN.

4 years agoMerge branch 'each-rename-copynf' into 'main'
Evan Hunt [Sat, 22 May 2021 08:10:10 +0000 (08:10 +0000)] 
Merge branch 'each-rename-copynf' into 'main'

rename dns_name_copynf() to dns_name_copy()

See merge request isc-projects/bind9!5081

4 years agoCHANGES
Evan Hunt [Sat, 22 May 2021 00:31:57 +0000 (17:31 -0700)] 
CHANGES

4 years agoupdate dev.md with name copying information
Evan Hunt [Sat, 22 May 2021 01:06:57 +0000 (18:06 -0700)] 
update dev.md with name copying information

revise the Developer Information document with updated information
about copying names.

4 years agoclean up coccinelle patches for dns_name_copy()
Evan Hunt [Sat, 22 May 2021 00:59:09 +0000 (17:59 -0700)] 
clean up coccinelle patches for dns_name_copy()

no need for semantic patches to use dns_name_copynf() any longer.

4 years agorename dns_name_copynf() to dns_name_copy()
Evan Hunt [Sat, 22 May 2021 00:20:44 +0000 (17:20 -0700)] 
rename dns_name_copynf() to dns_name_copy()

dns_name_copy() is now the standard name-copying function.

4 years agoremove dns_name_copy() implementation
Evan Hunt [Sat, 22 May 2021 00:17:23 +0000 (17:17 -0700)] 
remove dns_name_copy() implementation

Remove dns_name_copy() and refactor the underlying code since
it will only be called by dns_name_copynf() now, and can't fail.

4 years agoremove the remaining uses of dns_name_copy()
Evan Hunt [Sat, 22 May 2021 00:10:59 +0000 (17:10 -0700)] 
remove the remaining uses of dns_name_copy()

dns_name_copy() has been replaced nearly everywhere with
dns_name_copynf().  this commit changes the last two uses of
the original function.  afterward, we can remove the old
dns_name_copy() implementation, and replace it with _copynf().

4 years agoMerge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken...
Evan Hunt [Sat, 22 May 2021 04:30:19 +0000 (04:30 +0000)] 
Merge branch '2713-intermittent-crashes-in-the-tkey-system-test-caused-by-broken-dns_name_t-structures' into 'main'

Use dns_name_copy() to hold the copied name

Closes #2713

See merge request isc-projects/bind9!5079

4 years agoUse dns_name_copynf() with dns_message_gettempname() when needed
Ondřej Surý [Fri, 21 May 2021 13:30:00 +0000 (15:30 +0200)] 
Use dns_name_copynf() with dns_message_gettempname() when needed

dns_message_gettempname() returns an initialized name with a dedicated
buffer, associated with a dns_fixedname object.  Using dns_name_copynf()
to write a name into this object will actually copy the name data
from a source name. dns_name_clone() merely points target->ndata to
source->ndata, so it is faster, but it can lead to a use-after-free if
the source is freed before the target object is released via
dns_message_puttempname().

In a few places, clone was being used where copynf should have been;
this is now fixed.

As a side note, no memory was lost, because the ndata buffer used in
the dns_fixedname_t is internal to the structure, and is freed when
the dns_fixedname_t is freed regardless of the .ndata contents.

4 years agoMerge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'
Brian Conry [Fri, 21 May 2021 13:38:25 +0000 (13:38 +0000)] 
Merge branch '2662-fix-broken-SYSTEMTEST_NO_CLEAN' into 'main'

Preserve SYSTEMTEST_NO_CLEAN when run.sh calls make.

Closes #2662

See merge request isc-projects/bind9!5003

4 years agoPreserve additional environment variables with run.sh
Brian Conry [Wed, 19 May 2021 14:10:29 +0000 (09:10 -0500)] 
Preserve additional environment variables with run.sh

When executed in "legacy mode" (i.e. without the '-r' parameter)
run.sh invokes make with a modified environment.

SYSTEMTEST_FORCE_COLOR is now preserved for use by the individual test
scripts.

CYGWIN is now preserved for named, as it controls behavior relating to
crash reporting.