Vladimír Čunát [Mon, 13 Feb 2023 15:59:11 +0000 (16:59 +0100)]
lib/utils: fix timestamp format in dumps of records
The debug dumps of packets used UNIX timestamps (in RRSIG validity)
instead of the customary human stamps.
This was an unintentional regression of 0555828e, i.e. since v5.4.1
I looked again at all other differences from default kdig style,
and the only ones are that we don't show class and don't do IDN.
(both seem suitable here)
Vladimír Čunát [Wed, 22 Feb 2023 10:44:10 +0000 (11:44 +0100)]
ci: fix macOS builds
Let's specify more of the dependencies explicitly.
I suspect it was pkg-config that was missing;
https://github.com/CZ-NIC/knot-resolver/actions/runs/4241689540/jobs/7372234570
Oto Šťáva [Thu, 26 Jan 2023 07:45:24 +0000 (08:45 +0100)]
tests/pytests: quality-of-life improvements and notes
Added the option to run `kresd` inside `pytests` under `valgrind` and
`rr`, which can help with debugging. Also added a clarifying note that I
personally would have liked to have while exploring this.
Vladimír Čunát [Thu, 26 Jan 2023 16:07:01 +0000 (17:07 +0100)]
ci: allow failure for bad OBS distrotest jobs
They've been failing for many months, e.g. see
https://gitlab.nic.cz/knot/knot-resolver/-/pipelines/104497
This way it at least won't be confusing by showing red in CI.
Vladimír Čunát [Thu, 22 Dec 2022 12:58:53 +0000 (13:58 +0100)]
predict: fully deactivate prediction with `period = 0`
That setting is recommended by documentation but it would still leave
the timer triggering repeatedly. Maybe it didn't cause any practical
difference, but it was unnecessary and possibly confusing.
Vladimír Čunát [Thu, 14 Jul 2022 08:53:27 +0000 (10:53 +0200)]
TTL bounds: improve the logic
- apply to first (uncached) answer already
- don't extend over signature validity
Nit: the tests were using too high TTL (RFCs disallow the "sign bit").
It was working because (manual) cache-insertion was applying bounds,
but now the bounds don't get applied anymore, so it would fail.
Vladimír Čunát [Mon, 28 Feb 2022 18:10:16 +0000 (19:10 +0100)]
lib/cache: tweak TTL computation for packets
When a whole packet is cached (instead of individual RRs),
let's simplify the way the packet's TTL gets computed.
The previous mechanism came from commit 5b383a2bb7,
probably a misunderstanding of:
https://datatracker.ietf.org/doc/html/rfc2308#section-5
Anyway, I see no motivation to do it, and this way we should
get rid of some weird cases where we might extend TTL of some records,
except if they were below the cache.min_ttl() setting (5s default).
Vladimír Čunát [Fri, 7 Oct 2022 12:06:41 +0000 (14:06 +0200)]
add option to link sbin/kresd to jemalloc
And by default do so iff jemalloc is found.
I chose the simplicity of adding the chosen allocator just
in the single binary. Other sbin/* don't matter really,
and dynamic libs (e.g. modules) will just follow whoever loaded them.
Vladimír Čunát [Mon, 21 Nov 2022 11:52:55 +0000 (12:52 +0100)]
ci/images: drop the LXC images
Last use case was dropped in 36b08eb30387,
and I don't expect we'd use this in future anymore.
The "bullseye" in README was clearly a typo (it's the codename for 11).
Vladimír Čunát [Wed, 26 Oct 2022 16:45:21 +0000 (18:45 +0200)]
ci: make jobs interruptible by default
We're usually not interested in CI on older commits,
and this default will help cancelling expensive respdiff jobs.
Also add default runner tags to make them less likely
to get underspecified. For example, each job should choose
one option in the docker/lxc and amd64/arm64 pairs.
Vladimír Čunát [Wed, 26 Oct 2022 15:55:35 +0000 (17:55 +0200)]
ci pytests: migrate away from LXC runner
This reverts commit 15c1353544be, with some modifications.
On LXC we've had issues with
FileExistsError: [Errno 17] File exists: '/tmp/pytest-kresd-portdir'
.. which disappear with this commit. (I don't know how/why.)
Vladimír Čunát [Thu, 27 Oct 2022 15:31:07 +0000 (17:31 +0200)]
doc XDP: update the list of required capabilities
We're the same as knotd in this; it evolved a bit
with libknot and kernel versions. Taken from:
https://www.knot-dns.cz/docs/3.2/singlehtml/#mode-xdp-pre-requisites
Oto Šťáva [Thu, 20 Oct 2022 11:06:31 +0000 (13:06 +0200)]
daemon/network: fix heap-buffer-overflow in endpoint key generation
Reproducible by listening on an interface by name, ASAN reports a
heap-buffer-overflow. This was a regression caused by !1286, which did
not account for null-terminators properly.
Vladimír Čunát [Sun, 14 Aug 2022 15:15:18 +0000 (17:15 +0200)]
NEWS nit: prefer imperative formulations
We're mostly using those in NEWS and first line of commit messages.
I'm not sure if they're much better than alternatives, but at least
consistency is nice.
Vladimír Čunát [Wed, 3 Aug 2022 14:52:01 +0000 (16:52 +0200)]
daemon/worker: drop caching of kr_request mempools
This caused a huge increase in real memory usage in case of queries
arriving to kresd while being disconnected from internet.
The usage was slowly creeping up, even over 2G.
Interesting past commits: b350d38d and two preceding.
There apparently was no real memory leak. I assume that reusal of
long-living mempools is risky in terms of memory fragmentation,
though the extent of the issue surprised me very much.
The issue seemed the same with normal glibc and jemalloc.
I generally dislike ad-hoc optimization attempts like these freelists.
Now the allocator can better decide *itself* how to reuse memory.
Vladimír Čunát [Mon, 8 Aug 2022 16:40:15 +0000 (18:40 +0200)]
lib/generic/array: avoid quadratic work for long arrays
For long arrays we really want to increase their length by a fraction.
Otherwise it will cost lots of CPU. Doubling seems customary,
though I could imagine e.g. keeping the +50% growth on longest arrays.
I finally got sufficiently angry with this piece of code when debugging
https://forum.turris.cz/t/how-to-debug-a-custom-hosts-file-for-kresd/17449
though in that case it wasn't the main source of inefficiency.
CI: two of the mysterious/bogus warnings around arrays disappeared.