Commit Graph
41783 Commits
Author SHA1 Message Date
Nicki Křížek 5e771e7735 Track changes in separate files
Keep the changelog for each version in a separate source file to avoid
rebase conflicts when handling the -S version.
2024-09-24 16:13:50 +02:00
Nicki Křížek 2258bd1518 [9.20] chg: ci: Increase the load TCP/DoT shotgun perf tests
Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.

Backport of MR !9494

Merge branch 'backport-nicki/increase-tcp-dot-shotgun-load-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9548
2024-09-24 11:52:55 +00:00
Nicki Křížek c4ba41f498 Increase the load TCP/DoT shotgun perf tests
Due to the recent improvements to the TCP processing, much higher loads
can be handled by BIND9 without causing client timeouts. The updated
parameters give us useful data for both cold and hot cache testing.

(cherry picked from commit e89afd3349)
2024-09-24 11:17:43 +00:00
Mark Andrews b30274bc8c [9.20] fix: test: Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that read returns the
expected value for the message length or exit read loop.

Closes #4301

Backport of MR !9537

Merge branch 'backport-4301-check-read-value-in-ans4-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9545
2024-09-24 09:23:57 +00:00
Mark Andrews 2952f8339d Check read value in upforwd/ans4
The ans4 server wasn't shutting down cleanly sometimes.  Check that
read returns the expected value for the message length or exit read
loop.

(cherry picked from commit 21baad0a8f)
2024-09-24 07:29:29 +00:00
Michal Nowak 7c8f0afd44 [9.20] chg: test: Downgrade "timeout" and "attempts" arguments in shutdown
The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.

Also, see isc-projects/bind9#4943.

Backport of MR !9507

Merge branch 'backport-mnowak/shutdown-downgrade-timeout-and-attempts-arguments-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9541
2024-09-23 16:16:02 +00:00
Michal Nowak e7dd232320 Print correct udp/tcp function name in generic_query()
(cherry picked from commit 1c637e96d1)
2024-09-23 15:40:40 +00:00
Michal Nowak 69b116b788 Downgrade "timeout" and "attempts" arguments in shutdown
The shutdown system test sends queries when named is shutting down, not
in an attempt to get answers but to destabilize the server into a crash.
With isctest.query.udp() defaulting to try up to ten times with a
ten-second timeout to get a response we don't care about from a likely
terminated server, we make the test run much longer than needed because
of retries and long timeouts.

(cherry picked from commit 463ab2f3f5)
2024-09-23 15:40:39 +00:00
Michal Nowak f4489d0ded [9.20] chg: ci: Exclude some RPZ files from long stress test artifacts
This fixes 6f86885304, that excluded files
only from short stress tests.

Validation jobs:
- [x] short - [#4756989](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4756989/artifacts/browse/output/ns4/) - 
- [x] long - [#4757196](https://gitlab.isc.org/isc-projects/bind9/-/jobs/4757196/artifacts/browse/output/ns4/)

Backport of MR !9522

Merge branch 'backport-mnowak/exclude-some-rpz-files-from-long-stress-tests-artifacts-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9538
2024-09-23 12:25:11 +00:00
Michal Nowak aed660e57d Exclude some RPZ files from long stress test artifacts
This fixes 6f86885304, that excluded files
only from short stress tests.

(cherry picked from commit 871eeed519)
2024-09-23 11:20:49 +00:00
Ondřej Surý c511535b72 [9.20] chg: ci: Update code formatting
Backport of MR !9533

Merge branch 'backport-nicki/update-code-format-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9534
2024-09-21 11:20:07 +00:00
Nicki KřížekandOndřej Surý 7bb0a15578 Ignore clang-format reformatting commit
(cherry picked from commit 28d4e866c7)
2024-09-21 12:45:45 +02:00
Nicki KřížekandOndřej Surý 5662236fa1 Fix arguments-renamed pylint issue in iscconf.py
The argument name was different in the base class.

(cherry picked from commit 833ea7926c)
2024-09-21 12:45:27 +02:00
Nicki KřížekandOndřej Surý f2fa1b7d63 Update code formatting
clang 19 was updated in the base image.

(cherry picked from commit ebb5bd9c0f)
2024-09-21 12:45:27 +02:00
Ondřej Surý c5cadd29d8 [9.20] fix: usr: Fix long-running incoming transfers
Incoming transfers that took longer than 30 seconds would stop reading from the TCP stream and the incoming transfer would be indefinitely stuck causing BIND 9 to hang during shutdown.

This has been fixed and the `max-transfer-time-in` and `max-transfer-idle-in` timeouts are now honoured.

Closes #4949

Backport of MR !9531

Merge branch 'backport-4949-fix-ignored-and-invalid-dispatch-timeout-in-dns_xfrin-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9536
2024-09-21 10:37:48 +00:00
Ondřej Surý deba4670cb Don't enable timeouts in dns_dispatch for incoming transfers
The dns_dispatch_add() call in the dns_xfrin unit had hardcoded 30
second limit.  This meant that any incoming transfer would be stopped in
it didn't finish within 30 seconds limit.  Additionally, dns_xfrin
callback was ignoring the return value from dns_dispatch_getnext() when
restarting the reading from the TCP stream; this could cause transfers
to get stuck waiting for a callback that would never come due to the
dns_dispatch having already been shut down.

Call the dns_dispatch_add() without a timeout and properly handle the
result code from the dns_dispatch_getnext().

(cherry picked from commit 96ef98558c)
2024-09-21 08:53:25 +00:00
Ondřej Surý 4127068305 Modify dns_dispatch API to accept zero timeout
The dns_dispatch_add() has timeout parameter that could not be 0 (for
not timeout).  Modify the dns_dispatch implementation to accept a zero
timeout for cases where the timeouts are undesirable because they are
managed externally.

(cherry picked from commit 0f810b3144)
2024-09-21 08:53:25 +00:00
Nicki Křížek a0eada5388 [9.20] chg: dev: Restore the number of threadpool threads back to original value
The issue of long-running operations potentially blocking query resolution has been fixed. Revert this temporary workaround and restore the number of threadpool threads.

Related #4898

Backport of MR !9530

Merge branch 'backport-4898-remove-workaround-and-note-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9532
2024-09-20 15:46:12 +00:00
Nicki Křížek a2a4eef5b0 Remove fixed known issue [GL #4898]
(cherry picked from commit 9fc773ce4c)
2024-09-20 14:51:33 +00:00
Nicki Křížek 38fb8bed49 Revert "Double the number of threadpool threads"
This reverts commit 6857df20a4.

(cherry picked from commit 842abe9fbf)
2024-09-20 14:51:33 +00:00
Evan Hunt b1b2ab0cb3 [9.20] chg: minor cleanup in qpcache
when the QP cache was adapted from the RBTDB, some variable names weren't changed, and still incorrectly reference the RBT.

Backport of MR !9515

Merge branch 'backport-each-qpcache-nits-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9525
2024-09-19 22:37:07 +00:00
Evan Hunt c1b94dc622 rename 'rbtiterator' and similar names in qpcache
when the QP cache was adapted from the RBT database, some names
weren't changed. this could be confusing, so let's change them now.
also, we no longer need to include rbt.h.

(cherry picked from commit 5a444838db)
2024-09-19 15:02:23 -07:00
Nicki Křížek 379d7faeac Merge tag 'v9.20.2' into bind-9.20 2024-09-18 18:06:27 +02:00
Arаm Sаrgsyаn 1f553c61f7 [9.20] chg: usr: Set logging category for notify/xfer-in related messages
Some 'notify' and 'xfer-in' related log messages were logged at the
'general' category instead of their own category. This has been fixed.

Closes #2730

Backport of MR !9451

Merge branch 'backport-2730-logging-category-for-notify-and-xfer-related-messages-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9514
2024-09-17 17:45:30 +00:00
Aram Sargsyan 0098ff6456 Set logging category for notify/xfer related messages
Some notify/xfer related log messages are logged at the general
category. Set a more suitable caterogry for those messages.

(cherry picked from commit 7c45caa8a5)
2024-09-17 16:14:52 +00:00
Ondřej Surý 251b90c25e [9.20] fix: usr: Limit the outgoing UDP send queue size
If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  Try a bit harder to deliver the
outgoing UDP messages synchronously and if that fails, drop the outgoing
DNS message that would get queued up and then timeout on the client side.

Closes #4930

Backport of MR !9506

Merge branch 'backport-4930-limit-the-UDP-send-queue-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9511
2024-09-17 15:37:22 +00:00
Ondřej Surý 6bff6df272 Limit the outgoing UDP send queue size
If the operating system UDP queue gets full and the outgoing UDP sending
starts to be delayed, BIND 9 could exhibit memory spikes as it tries to
enqueue all the outgoing UDP messages.  As those are not going to be
delivered anyway (as we argued when we stopped enlarging the operating
system send and receive buffers), try to send the UDP messages directly
using `uv_udp_try_send()` and if that fails, drop the outgoing UDP
message.

(cherry picked from commit b576c4c977)
2024-09-17 16:31:25 +02:00
Alessio Podda 6c9f3d0d1e [9.20] fix: usr: Do not set SO_INCOMING_CPU
We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue by setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

Closes #4936

Backport of MR !9497

Merge branch 'backport-4936-remove-so-incoming-cpu-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9504
2024-09-16 13:39:18 +00:00
alessio 6e42d96cf1 Do not set SO_INCOMING_CPU
We currently set SO_INCOMING_CPU incorrectly, and testing by Ondrej
shows that fixing the issue and setting affinities is worse than letting
the kernel schedule threads without constraints. So we should not set
SO_INCOMING_CPU anymore.

(cherry picked from commit 8b8149cdd2)
2024-09-16 12:57:08 +00:00
Arаm Sаrgsyаn 2287dc0ac0 [9.20] fix: usr: Fix a statistics channel counter bug when 'forward only' zones are used
When resolving a zone with a 'forward only' policy, and
finding out that all the forwarders are marked as "bad",
the 'ServerQuota' counter of the statistics channel was
incorrectly increased. This has been fixed.

Closes #1793

Backport of MR !9493

Merge branch 'backport-1793-serverquota-counter-bug-with-forward-only-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9502
2024-09-16 12:25:19 +00:00
Aram Sargsyan 80dad234ba Add a statistics channel check in the forward system test
Check that the fix in the previous commit works and that the
'ServerQuota' counter in the statistics channel is still unset
after a SERVFAIL result in a 'forward only' zone.

(cherry picked from commit 81b3c5d908)
2024-09-16 09:31:38 +00:00
Aram Sargsyan 59cc292928 Fix a 'serverquota' counter calculation bug
The 'all_spilled' local variable in resolver.c:fctx_getaddresses()
is 'true' by default, and only becomes false when there is at least
one successfully found NS address. However, when a 'forward only;'
configuration is used, the code jumps over the part where it looks
for NS addresses and doesn't reset the 'all_spilled' to false, which
results in incorretly increased 'serverquota' statistics variable,
and also in invalid return error code from the function. The result
code error didn't make any differences, because all codes other than
'ISC_R_SUCCESS' or 'DNS_R_WAIT' were treated in the same way, and
the result code was never logged anywhere.

Set the default value of 'all_spilled' to 'false', and only make it
'true' before actually starting to look up NS addresses.

(cherry picked from commit e430ce7039)
2024-09-16 09:31:38 +00:00
Mark Andrews 12eb16186f [9.20] chg: dev: Remove statslock from dnssec-signzone
Silence Coverity CID 468757 and 468767 (DATA RACE read not locked) by converting dnssec-signzone to use atomics for statistics counters rather than using a lock.

Closes #4939

Backport of MR !9496

Merge branch 'backport-4939-remove-stats-lock-from-dnssec-signzone-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9500
2024-09-16 03:29:39 +00:00
Mark Andrews b33727a202 Remove 'statslock' from dnssec-signzone
Silence Coverity CID 468757 and 468767 (DATA RACE read not locked)
by converting dnssec-signzone to use atomics for statistics counters
rather than using a lock.  This should be marginally faster than
using the lock as well when statistics are requested.

(cherry picked from commit 473cbd4e87)
2024-09-16 02:52:38 +00:00
Ondřej Surý c0022f6802 [9.20] fix: usr: Separate DNSSEC validation from the long-running tasks
As part of the KeyTrap \[CVE-2023-50387\] mitigation, the DNSSEC CPU-intensive operations were offloaded to a separate threadpool that we use to run other tasks that could affect the networking latency.

If that threadpool is running some long-running tasks like RPZ, catalog zone processing, or zone file operations, it would delay DNSSEC validations to a point where the resolving signed DNS records would fail.

Split the CPU-intensive and long-running tasks into separate threadpools in a way that the long-running tasks don't block the CPU-intensive operations.

Closes #4898

Backport of MR !9473

Merge branch 'backport-4898-move-offloaded-DNSSEC-to-own-threads-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9495
2024-09-12 15:46:28 +00:00
Ondřej Surý 26c2cbe63b Move offloaded DNSSEC operations to different helper threads
Currently, the isc_work API is overloaded.  It runs both the
CPU-intensive operations like DNSSEC validations and long-term tasks
like RPZ processing, CATZ processing, zone file loading/dumping and few
others.

Under specific circumstances, when many large zones are being loaded, or
RPZ zones processed, this stops the CPU-intensive tasks and the DNSSEC
validation is practically stopped until the long-running tasks are
finished.

As this is undesireable, this commit moves the CPU-intensive operations
from the isc_work API to the isc_helper API that only runs fast memory
cleanups now.

(cherry picked from commit 8a96a3af6a)
2024-09-12 16:41:02 +02:00
Ondřej Surý 17f23224d1 Add isc_helper API that adds 1:1 thread for each loop
Add an extra thread that can be used to offload operations that would
affect latency, but are not long-running tasks; those are handled by
isc_work API.

Each isc_loop now has matching isc_helper thread that also built on top
of uv_loop.  In fact, it matches most of the isc_loop functionality, but
only the `isc_helper_run()` asynchronous call is exposed.

(cherry picked from commit 6370e9b311)
2024-09-12 14:39:07 +00:00
Michal Nowak f0277b7284 [9.20] chg: test: Replace dns.resolver module in system tests
Closes #4634

Backport of MR !9150

Merge branch 'backport-4634-drop-dns.resolver-module-from-system-tests-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9491
2024-09-12 11:19:04 +00:00
Michal Nowak 944fc02f83 Extract dns.rcode compatibility code to isctest.compat
(cherry picked from commit 8b55d0709d)
2024-09-12 11:17:52 +00:00
Michal Nowak c8c8b36e44 Turn off deadline for wildcard tests
Tests that query BIND need much longer deadline to account for retries,
the default 200ms won't work.

(cherry picked from commit d2e0043ec3)
2024-09-12 11:17:52 +00:00
Michal Nowak 937d7f30eb Extract "custom" named instances support to isctest.run module
(cherry picked from commit 2cec1de43b)
2024-09-12 11:17:52 +00:00
Michal Nowak 531567b0a1 Rework query functions to retry by default
(cherry picked from commit 5929ba0f54)
2024-09-12 11:17:52 +00:00
Michal Nowak f7e03b4f3f Deprecate dns.resolver module in BIND 9 system tests
(cherry picked from commit cb3ffac9a7)
2024-09-12 11:17:52 +00:00
Michal Nowak 555f42754e Replace dns.resolver module in system tests
(cherry picked from commit bfe338b965)
2024-09-12 11:17:52 +00:00
Arаm Sаrgsyаn 3b5c4f94d7 [9.20] fix: dev: Fix data race in offloaded dns_message_checksig()
When verifying a message in an offloaded thread there is a race with
the worker thread which writes to the same buffer. Clone the message
buffer before offloading.

Closes #4929

Backport of MR !9481

Merge branch 'backport-4929-data-race-in-dns_dnssec_verifymessage-memmove-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9490
2024-09-12 10:34:07 +00:00
Aram Sargsyan 65fced42b9 Fix data race in offloaded dns_message_checksig()
When verifying a message in an offloaded thread there is a race with
the worker thread which writes to the same buffer. Clone the message
buffer before offloading.

(cherry picked from commit 35ef25e5ea)
2024-09-12 09:12:35 +00:00
Mark Andrews 02822b70ee [9.20] fix: usr: Don't allow statistics-channel if libxml2 and libjson-c are unsupported
When the libxml2 and libjson-c libraries are not supported, the statistics channel can't return anything useful, so it is now disabled. Use of `statistics-channel` in `named.conf` is a fatal error.

Closes #4895

Backport of MR !9423

Merge branch 'backport-4895-link-style-sheet-to-libxml2-support-9.20' into 'bind-9.20'

See merge request isc-projects/bind9!9486
2024-09-12 04:07:13 +00:00
Mark Andrews 4dcfa7b580 Fix named-checkconf and statistics-channels
If neither libxml2 nor libjson_c are available have named-checkconf
fail if a statistics-channels block is specified.

(cherry picked from commit b9246418e8)
2024-09-12 03:27:38 +00:00
Mark Andrews c52a9a5731 Only configure statistics-channels if supported
(cherry picked from commit d0c8c6d7ef)
2024-09-12 03:27:38 +00:00
Mark Andrews b3c0eb9bac Don't create the HTTP server if libxml and libjson-c are unavailable
(cherry picked from commit 31650d9440)
2024-09-12 03:27:38 +00:00