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.
Vladimír Čunát [Wed, 15 Jun 2022 08:46:19 +0000 (10:46 +0200)]
adapt to libknot 3.2 lower-casing knot_pkt_qname()
Our strategy was (and remains) that the in-header QNAME is overwritten
in-place, so most of our code was already (correctly) assuming that
knot_pkt_qname() returns lower-case only. That simplifies this commit.
Vladimír Čunát [Mon, 27 Jun 2022 08:37:13 +0000 (10:37 +0200)]
ci/pkgtest: switch bad LXC builds to manual start
We've been unable to progress with these failures for some time,
and it's not good to have them red in CI all the time.
Manual start should allow easier testing of future fixes,
without doing the futile runs automatically.
Oto Šťáva [Wed, 13 Jul 2022 06:21:48 +0000 (08:21 +0200)]
ci: confine docker and macOS jobs to main repository
Some of our CI jobs use project-specific GitLab runners (e.g. requiring
the `dind` tag). The jobs then fail when someone forks the repository
and opens a merge request. This commit confines those jobs to the
`knot/knot-resolver` repository.
Oto Šťáva [Thu, 23 Jun 2022 08:14:58 +0000 (10:14 +0200)]
daemon/tls: fix a double-free for some cases of policy.TLS_FORWARD
The double-free may have happened in some cases when the upstream
resolver was stopped while answering a forwarded query. I was reliably
reproducing it by running resperf on two kresd instances with one forwarded
to the other, and killing the upstream one.
Vladimír Čunát [Thu, 16 Jun 2022 08:12:22 +0000 (10:12 +0200)]
modules/priming: don't warn against unloading it
I can't see sufficient motivation here. The cache will be slightly
less ready, but it's not often that you need to contact a root server.
Most importantly, kresd must work well anyway, even with empty cache.
Also, the compiled-in address set of root servers should be quite
accurate - the NS set has never changed, and the last address change
was five years ago with just one of 26 records changing.
Oto Šťáva [Fri, 17 Jun 2022 08:57:58 +0000 (10:57 +0200)]
daemon/http: improve URI checks
The `check_uri()` function now only checks that the endpoint is either
`/doh` or `/dns-query`. Parameter checks were moved into
`process_uri_path()` so that the check only takes place for GET
requests. POST requests now do not care about parameters at all.