2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-29 05:28:00 +00:00

41111 Commits

Author SHA1 Message Date
Ondřej Surý
0b32d323e0
Simplify the parent cleaning in the prune_tree() mechanism
Instead of juggling with node locks in a cycle, cleanup the node we are
just pruning and send any the parent that's also subject to the pruning
to the prune tree via normal way (e.g. enqueue pruning on the parent).

This simplifies the code and also spreads the pruning load across more
event loop ticks which is better for lock contention as less things run
in a tight loop.
2024-02-29 11:23:03 +01:00
Ondřej Surý
eed17611d8
Reduce lock contention during RBTDB tree pruning
The log message for commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1
explained:

    In some older BIND 9 branches, the extra queuing overhead eliminated by
    this change could be remotely exploited to cause excessive memory use.
    Due to architectural shift, this branch is not vulnerable to that issue,
    but applying the fix to the latter is nevertheless deemed prudent for
    consistency and to make the code future-proof.

However, it turned out that having a single queue for the nodes to be
pruned increased lock contention to a level where cleaning up nodes from
the RBTDB took too long, causing the amount of memory used by the cache
to grow indefinitely over time.

This commit reverts the change to the pruning mechanism introduced by
commit 24381cc36d8528f5a4046fb2614451aeac4cdfc1 as BIND branches newer
than 9.16 were not affected by the excessive event queueing overhead
issue mentioned in the log message for the above commit.
2024-02-29 11:23:03 +01:00
Artem Boldariev
264a3a92b2 Merge branch '4156-docs-ephemeral-tls-recreation' into 'main'
Improve documentation on ephemeral TLS configuration

Closes #4156

See merge request isc-projects/bind9!8771
2024-02-28 19:40:35 +00:00
Artem Boldariev
1ab0f6d918 Improve documentation on ephemeral TLS configuration
This commit improves the documentation on the ephemeral TLS
configuration and describes in more detail what is happening with TLS
configurations on reconfiguration in general.
2024-02-28 20:30:38 +02:00
Mark Andrews
5b23c964e2 Merge branch '4604-fix-initial-tests-in-masterfile-system-test' into 'main'
Resolve "Fix initial tests in masterfile system test"

Closes #4604

See merge request isc-projects/bind9!8787
2024-02-28 00:16:39 +00:00
Mark Andrews
e02b73c7a4 Split the first masterfile test into 3
Additionally read the correct zone for BIND 8 ttl checks
2024-02-27 15:42:06 +11:00
Michal Nowak
b2c573843a Merge branch 'mnowak/dialup-watch-log-from-start' into 'main'
Watch logs from start in dialup system test

See merge request isc-projects/bind9!8782
2024-02-26 11:10:22 +00:00
Michal Nowak
283a7ab17d
Watch logs from start in dialup system test
When the first parametrized test takes a bit longer than usual, the zone
transfer in ns3 may succeed before the second parametrized test is even
started, and then watch_log_from_here() won't find the "Transfer status:
success" message in the named log. Using watch_log_from_start() instead
makes sure the test is more stable.
2024-02-26 11:22:40 +01:00
Mark Andrews
078d514764 Merge branch '4413-add-resinfo-261-type-to-named' into 'main'
Resolve "Add RESINFO (261) type to named"

Closes #4413

See merge request isc-projects/bind9!8464
2024-02-26 02:16:42 +00:00
Mark Andrews
1bf03a2e9a Add CHANGES entry for [GL #4413] 2024-02-26 12:02:40 +11:00
Mark Andrews
0651063658 Add RESINFO record type
This is a TXT clone using code point 261.
2024-02-26 12:02:40 +11:00
Michal Nowak
ef965acd34 Merge branch 'mnowak/pytest_rewrite_dsdigest' into 'main'
Rewrite dsdigest system test to pytest

See merge request isc-projects/bind9!8770
2024-02-23 13:18:42 +00:00
Michal Nowak
cfb68bda79
Rewrite dsdigest system test to pytest 2024-02-23 13:41:04 +01:00
Michal Nowak
5830ac831f
Add isctest.check.servfail() 2024-02-23 12:02:32 +01:00
Ondřej Surý
0498d0d1e0 Merge branch '4595-fix-expire-lru-headers-race' into 'main'
Do not use header_prev in expire_lru_headers

Closes #4595

See merge request isc-projects/bind9!8773
2024-02-23 11:00:56 +00:00
Mark Andrews
4f8539ac23
Add CHANGES and release note for [GL #4495] 2024-02-23 12:00:12 +01:00
Mark Andrews
7ce2e86024
Do not use header_prev in expire_lru_headers
dns__cacherbt_expireheader can unlink / free header_prev underneath
it.  Use ISC_LIST_TAIL after calling dns__cacherbt_expireheader
instead to get the next pointer to be processed.
2024-02-23 12:00:12 +01:00
Michal Nowak
edf70d5f6c Merge branch 'mnowak/pytest_rewrite_xferquota' into 'main'
Rewrite xferquota system test to pytest

See merge request isc-projects/bind9!8676
2024-02-23 10:48:38 +00:00
Michal Nowak
69bf4432cc
Rewrite xferquota system test to pytest 2024-02-23 11:04:51 +01:00
Michal Nowak
1e52a11343
Add isctest.check.rrsets_equal function 2024-02-23 11:04:51 +01:00
Michal Nowak
5694c52f52
Add retry_with_timeout() utility function 2024-02-23 11:04:51 +01:00
Michal Nowak
6dd1b3ab38
Add RegEx support to wait_for_line() and wait_for_lines() 2024-02-23 11:04:51 +01:00
Ondřej Surý
c4dbf410b7 Merge branch '4597-placeholder' into 'main'
Add CHANGES placeholder for [GL #4597]

See merge request isc-projects/bind9!8772
2024-02-23 07:49:48 +00:00
Ondřej Surý
e7e268c362 Add CHANGES placeholder for [GL #4597] 2024-02-23 08:40:42 +01:00
Michal Nowak
e5a98f14bf Merge branch 'mnowak/pytest_rewrite_sortlist' into 'main'
Rewrite sortlist system test to pytest

See merge request isc-projects/bind9!8684
2024-02-22 17:39:02 +00:00
Michal Nowak
bcbe34e22d
Make pytest a bit more verbose
The "-vv" option gives us full untruncated diffs of compared data
strustures.
2024-02-22 18:03:30 +01:00
Michal Nowak
e7b5cf7f79
Rewrite sortlist system test to pytest 2024-02-22 18:02:25 +01:00
Michal Nowak
4a203dcb93
Support "source" parameter in isctest.query.(tcp|udp) 2024-02-22 14:32:04 +01:00
Artem Boldariev
ce33f8e941 Merge branch 'artem-transferslowly-transferstuck-via-timers' into 'main'
Do not block workers when using -T transferslowly/transferstuck

Closes #4566

See merge request isc-projects/bind9!8751
2024-02-21 23:36:31 +00:00
Artem Boldariev
f8812d4184 Do not lock workers when using -T transferslowly/transferstuck
This commit ensures that worker threads are not sleeping (by using
select()) when '-T transferslowly/transferstuck' test options are
used. This commit converts synchronous implementation of the code into
an asynchronous one based on timers.
2024-02-22 00:09:04 +02:00
Artem Boldariev
6406c39edc Merge branch '4572-do-not-crash-resolver-when-tlsctx-creation-failed' into 'main'
DoT: do not crash resolver on TLS context creation failure

Closes #4572

See merge request isc-projects/bind9!8727
2024-02-21 20:41:26 +00:00
Artem Boldariev
6ce6567564
Update CHANGES [GL #4572]
Mention that BIND should not abort anymore when trying to connect to a
remote server via TLS when using an incorrect 'tls' configuration.
2024-02-21 21:42:27 +02:00
Artem Boldariev
17632ad22a Add a system test for #4572
This commit adds a test which exactly reproduces the situation give by
the bug reporter.
2024-02-21 21:05:21 +02:00
Artem Boldariev
4cbe1eb368 DoT: do not crash resolver on TLS context creation failure
The resolver's code was not ready to failures when trying to establish
a connection via TCP-based transports (e.g. when creating TLS contexts
before establishing a TLS connection).

This commit fixes that.
2024-02-21 21:05:21 +02:00
Arаm Sаrgsyаn
2616519a95 Merge branch '4588-cid-486508-control-flow-issue' into 'main'
Clean up fetch_answered

Closes #4588

See merge request isc-projects/bind9!8753
2024-02-21 10:51:32 +00:00
Aram Sargsyan
9e38d0e3af Clean up fetch_answered
After the changes in [GL #4447] the 'fetch_answered' variable is
always false now. Delete the unnecessary code.
2024-02-20 10:46:40 +00:00
Tom Krizek
366b93f835 Merge branch 'tkrizek/pytest-log' into 'main'
Simplify pytest logging

See merge request isc-projects/bind9!8742
2024-02-16 15:00:32 +00:00
Tom Krizek
8058140b67
Don't include temp testdir on each log line
This was mostly an artifact to tell which log lines belong to which test
from the time when the test output could be all mingled together. Now
this info is reduntant, because the pytest logger already includes both
the system test name, and the specific test.
2024-02-16 14:56:00 +01:00
Tom Krizek
c60975f108
Add utility logging functions to isctest.log
Unify the different loggers (conftest, module, test) into a single
interface. Remove the need to select the proper logger by automatically
selecting the most-specific logger currently available.

This also removes the need to use the logger/mlogger fixtures manually
and pass these around. This was especially annoying and unwieldy when
splitting the test cases into functions, because logger had to always be
passed around. Instead, it is now possible to use the
isctest.log.(debug,info,warning,error) functions.
2024-02-16 14:56:00 +01:00
Tom Krizek
52f9e6f557
Move watchlog module into isctest.log package
Preparation for further logging improvements - keep the watchlog
contents in a separate module inside isctest.log. Export the names in
the log package so the imports don't change for the users of these
classes.
2024-02-16 14:56:00 +01:00
Tom Krizek
f8fa528cdd
Remove accidentally duplicated RNDCExecutor code
This code has probably been accidentally added during some rebase. The
actual RNDCExecutor and related classes are in isctest/rndc.py. Remove
the duplicated and unused code from isctest/log.py, as it doesn't belong
there.
2024-02-16 14:55:55 +01:00
Arаm Sаrgsyаn
7f924a12f4 Merge branch '4447-disallow-stale-answer-client-timeout-non-zero' into 'main'
Disallow stale-answer-client-timeout non-zero values

Closes #4447

See merge request isc-projects/bind9!8699
2024-02-16 09:35:13 +00:00
Aram Sargsyan
03b68b8c38 Address scan-build warnings
The warnings (see below) seem to be false-positives. Address them
by adding runtime checks.

    resolver.c:1627:10: warning: Access to field 'tid' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     1627 |         REQUIRE(fctx->tid == isc_tid());
          |                 ^~~~~~~~~
    ../../lib/isc/include/isc/util.h:332:34: note: expanded from macro 'REQUIRE'
      332 | #define REQUIRE(e)   ISC_REQUIRE(e)
          |                                  ^
    ../../lib/isc/include/isc/assertions.h:45:11: note: expanded from macro 'ISC_REQUIRE'
       45 |         ((void)((cond) ||                                                  \
          |                  ^~~~
    resolver.c:10335:6: warning: Access to field 'depth' results in a dereference of a null pointer (loaded from variable 'fctx') [core.NullDereference]
     10335 |         if (fctx->depth > depth) {
           |             ^~~~~~~~~~~
    2 warnings generated.
2024-02-16 08:42:48 +00:00
Aram Sargsyan
152c6e2274 Add CHANGES and release notes for [GL #4447] 2024-02-16 08:42:47 +00:00
Aram Sargsyan
bd7463914f Disallow stale-answer-client-timeout non-zero values
Remove all the code and tests which support non-zero
stale-answer-client-timeout values, and adjust the
documentation.
2024-02-16 08:41:52 +00:00
Evan Hunt
a2dc8ebcc0 Merge branch 'each-rbtdb-dbiterator-fixes' into 'main'
fix several bugs in the RBTDB dbiterator implementation

See merge request isc-projects/bind9!8741
2024-02-15 18:52:47 +00:00
Evan Hunt
32241022b5 CHANGES for [GL !8741] 2024-02-15 10:15:50 -08:00
Evan Hunt
e40fd4ed06 fix several bugs in the RBTDB dbiterator implementation
- the DNS_DB_NSEC3ONLY and DNS_DB_NONSEC3 flags are mutually
  exclusive; it never made sense to set both at the same time.
  to enforce this, it is now a fatal error to do so.  the
  dbiterator implementation has been cleaned up to remove
  code that treated the two as independent: if nonsec3 is
  true, we can be certain nsec3only is false, and vice versa.
- previously, iterating a database backwards omitted
  NSEC3 records even if DNS_DB_NONSEC3 had not been set. this
  has been corrected.
- when an iterator reaches the origin node of the NSEC3 tree, we
  need to skip over it and go to the next node in the sequence.
  the NSEC3 origin node is there for housekeeping purposes and
  never contains data.
- the dbiterator_test unit test has been expanded, several
  incorrect expectations have been fixed. (for example, the
  expected number of iterations has been reduced by one; we were
  previously counting the NSEC3 origin node and we should not
  have been doing so.)
2024-02-15 10:15:50 -08:00
Evan Hunt
88c56e25a1 Merge branch 'each-zone-xfrin-race' into 'main'
prevent a possible race in setting up zone->xfr

See merge request isc-projects/bind9!8716
2024-02-14 21:50:25 +00:00
Evan Hunt
7d59a0ed81 prevent a possible race in setting up zone->xfr
the call to dns_xfrin_create() wrote to zone->xfr with
the zone unlocked.
2024-02-14 18:53:17 +00:00