Vladimír Čunát [Mon, 30 May 2022 11:48:16 +0000 (13:48 +0200)]
meson nit: deal with warning about future of run_command
WARNING: You should add the boolean check kwarg to the run_command call.
It currently defaults to false,
but it will default to true in future releases of meson.
See also: https://github.com/mesonbuild/meson/issues/9300
In almost all cases we already check the return code explicitly
and throw a more descriptive message than what would be the default.
https://man7.org/linux/man-pages/man3/posix_fallocate.3.html#ERRORS:
> EOPNOTSUPP
> The filesystem containing the file referred to by fd does not support
> this operation. This error code can be returned by C libraries that
> don't perform the emulation shown in NOTES, such as **musl libc**.
I've encountered this problem on Alpine Linux running inside an LXC
container on Ubuntu with data on ZFS.
Vladimír Čunát [Wed, 27 Apr 2022 14:03:06 +0000 (16:03 +0200)]
lib/dnssec: rewrite kr_nsec_ref_to_unsigned()
- I see no motivation to search for NS records here;
and I didn't like that loop nesting
- philosophy shift akin to the recent
replacement of kr_nsec_existence_denial()
Vladimír Čunát [Sat, 23 Apr 2022 15:23:47 +0000 (17:23 +0200)]
lib/dnssec: replace kr_nsec_existence_denial()
The NSEC validation code has been written very mechanically
according to RFC 4033..4035, but those explain wildcard-related
topics in a way that's hard to understand right.
So here I rewrite it with a different philosophy, so it should be
easier to understand, a bit faster, and less buggy and bug-prone.
Vladimír Čunát [Fri, 13 May 2022 10:52:20 +0000 (12:52 +0200)]
lib/utils kr_sockaddr_key_same_addr(): more precision
... in case of IPv6 link-local addresses.
The casting isn't very nice, but we certainly rely on `family` being
always on the same offset anyway (and it's ensured by standards).
Vladimír Čunát [Mon, 11 Apr 2022 10:14:50 +0000 (12:14 +0200)]
daemon/zimport: close transaction after importing batch
I'm really sorry about this. It's my regression in 5.5.0 (!1225)
Practical consequence was that the RW transaction was held open
until that instance did something with cache (and thus closed),
so any other instance would be frozen in the meantime if doing
anything non-read-only with cache (e.g. startup).
https://lists.nic.cz/hyperkitty/list/knot-resolver-users@lists.nic.cz/thread/6DOXXOA6ACEUBVYPUY3T2MLGIHWOMV6M/
Vladimír Čunát [Thu, 7 Apr 2022 08:05:34 +0000 (10:05 +0200)]
ci: fix ambiguous tag-sets
In a few places the tag-set specification for jobs could match
either amd64 or arm64 runners. That non-determinism is bad,
especially when passing platform-specific artifacts around.
This is just a stop-gap measure. Later we'll need to rethink our CI
in terms of the two platforms.
I didn't touch tag-sets with `condor`, as that will probably always be
just a single machine (which coordinates scheduling on others).
Vladimír Čunát [Mon, 14 Mar 2022 14:27:54 +0000 (15:27 +0100)]
predict docs: be more explicit about recommended use
We're still run into people who thought that the example config
is a suitable default. Example where it caused practical issues:
https://lists.nic.cz/hyperkitty/list/knot-resolver-users@lists.nic.cz/thread/WQDJJ3LLEIZ5U3VVSCITW6DZPICW4L7U/
CI rp:fwd-tls6.udp-asan now repeatedly shows use-after-free.
That could be a serious issue, and this commit's feature
seems less important than the risk. Let's revert until the issue
gets deeper investigation.
Vladimír Čunát [Mon, 7 Mar 2022 17:04:05 +0000 (18:04 +0100)]
lib/selection: fix interaction of timeouts with reboots
We use "monotonic" time-stamps for the dead_since field;
that breaks on system reboots, in which case we reset the stats.
(if the server was categorized as dead)
If the server times out afterwards, we'd fail the condition
`cur_state.consecutive_timeouts == old_state.consecutive_timeouts`
so its stats would not update. Therefore we'd get stuck forever
in a state where the unusable server has high priority (no_rtt_info).
This commit changes a bit more than was necessary to fix this,
including precision of the stats (in some cases).
Vladimír Čunát [Fri, 4 Mar 2022 11:55:55 +0000 (12:55 +0100)]
lib/selection: improve randomness of ties
The approach was dubious: random shuffle, qsort() and choose the first.
The main functional problem was that qsort() isn't a stable sort,
so the effect of pre-shuffling is not reliable, even though I don't have
any evidence of this causing issues in practice.
The new code should also be a bit more efficient in terms of CPU and
consumed randomness, but that probably won't be noticeable.
The arrays passed into select_transport() are now const (no sorting),
which could make the code easier to "understand".
Vladimír Čunát [Tue, 8 Feb 2022 11:46:55 +0000 (12:46 +0100)]
modules/dnstap: don't do anything on loading the module
Usually in configuration the module is loaded in a separate command
from passing configuration to it. For dnstap this loading would
immediately lead to opening the default socket path, even if the
configuration actually specifies (a different) path later.
Users can still force using the default by passing an empty table:
`dnstap.config({})` or `modules = { dnstap = {}}`
(though I doubt the utility of the default /tmp/dnstap.sock anyway)