Tomas Krizek [Thu, 12 Dec 2019 16:20:40 +0000 (17:20 +0100)]
ci: allow failure of obs:build:all
This job tends to fail very often, but very frequently due to issues
with OBS itself - outside of our control. The output of the job can
still be useful to check manually, e.g. before releases.
Tomas Krizek [Wed, 9 Oct 2019 12:29:28 +0000 (14:29 +0200)]
lua: stop trying to tweak lua's GC
cherry-picked from f0ca89ac, original author Vlada Cunat
TL;DR: I believe all lua_gc() calls stemmed from misunderstanding lua
documentation, and the current settings seem potentially dangerous.
First, let me rely on lua 5.1 docs, as luajit 2 is documented to have
done only minor changes in the GC.
http://www.lua.org/manual/5.1/manual.html#lua_gc
http://wiki.luajit.org/New-Garbage-Collector#rationale
Commit 5a709411 claims to have increased the speed of GC to 400 % of
speed of allocation, but LUA_GCSETSTEPMUL is the parameter that
controls that, and that one was lowered to 99 % and later in 0ee2d1d7 even to 50 %. Documentation explicitly says that setting
the value under 100 % may cause problems.
The default values seem perfectly sane to me and currently I can't see
any particular reason to change them. It's 200 % relative GC speed,
and waiting for allocated size to double before starting another cycle.
I assume the resulting possibility of GC being too slow caused the need
to explicitly force a non-incremental GC cycle once in a while, but
that seems not useful anymore and not good for latency.
Vladimír Čunát [Tue, 10 Dec 2019 16:08:30 +0000 (17:08 +0100)]
daemon/io: use SO_REUSEPORT_LB if available (FreeBSD 12.0+)
and don't use SO_REUSEPORT on non-Linux. (Free)BSD has a different
meaning for it, which only brings confusion - only the last instance
would be getting packets.
Vladimír Čunát [Wed, 13 Nov 2019 13:07:46 +0000 (14:07 +0100)]
iterate: better efficiency on huge RRsets
- written relatively defensively - act OK even if the API
isn't used in an ideal way
- CI lint:scan-build: bump the error count;
It's only another instance of the mis-detected array_push().
- the removed stale note in modules/meson.build isn't really related
Vladimír Čunát [Wed, 14 Aug 2019 14:53:23 +0000 (16:53 +0200)]
modules/ta_sentinel: optimize
When all lua modules get unloaded, this change makes the module's
contribution to QPS unmeasurable (for me), saving a few percent.
The point is to almost always return very cheaply, in particular without
creating any lua GC object (like FFI for kr_query).
Note: some checks didn't make much sense, so I improved those as well.
Vladimír Čunát [Wed, 7 Aug 2019 07:36:13 +0000 (09:36 +0200)]
lua FFI: avoid frequent usage of lua_pushpointer()
The new way of transitioning to layer callbacks - done because of
portability (mainly to aarch64) - is a bit expensive. This is a simple
way of recovering that cost. Merge 603a24f regressed speed a bit.
Lukáš Ježek [Mon, 18 Nov 2019 11:16:42 +0000 (12:16 +0100)]
tests: packaging
Directory with subdirectory "packaging" is called "component".
List all components: python3 tests/packaging-doc.py --list
Run all tests/compoments: python3 tests/packaging-doc.py
Run specific test/component: python3 tests/packaging-doc.py --test <component>
The file structure for 1 component:
daemon - dependencies for 1 component "kresd daemon" (default component, must always be there)
scripts/distros - dependencies for 1 component for specific distro (must always be there)
scripts/dockerfile_gen.py - test Dockerfile generator, see below
tests/packaging.py - script to generate and build all combinations
of Docker files for all components
[component] - directory of component/test, see below
(e.g. "client/packaging/", "modules/http/packaging/" etc.)
The file structure of each component:
[component]
<distro>/<version> - package names
- builddeps - list of build depedencies
- rundeps - list of runtime depedencies
- pre-build.sh - script called before build phase
- post-build.sh - script called after build phase
- pre-run.sh - script called before run phase
- post-run.sh - script called after run phase
- install.sh and build.sh script called during build phase
test.config or test.sh - kresd config test or shell script
note: content of "scripts/distroos" is same as "<distro>/<version>" of component.
There are "build" and "run" phases. "build" phase precedes "run" phase.
All script are called in this order:
1. pre-<phase>.sh
2. install packages specifed in the file "<phase>deps"
3a. for "build" phase: run build.sh and install.sh
3b. for "run" phase: run 'kresd -c [component]/test.config' or config.sh
4. remove packages specified in the file "<phase>deps"
5. post-<phase>.sh
Each step above is combines base components with a component under test.
E.g. component "scripts/distros" always precedes component "daemon/packaging"
and it precedes the tested component e.g. "modules/http".
In long term we might migrate this to py.test or some other well known
framework.
Petr Špaček [Tue, 22 Oct 2019 10:03:30 +0000 (12:03 +0200)]
doh debug: rename SSLKEYLOG environment variable to OPENSSLKEYLOG
This avoids conflict between GnuTLS's built-in SSLKEYLOG and our hack
for OpenSSL. This would be important for instances which run
DNS-over-TLS using built-in GnuTLS
and at the same time DNS-over-HTTPS using lua-http (based on OpenSSL).
Vladimír Čunát [Thu, 24 Oct 2019 08:35:31 +0000 (10:35 +0200)]
cache entry_list: fix crash on insertion via lua
When inserting NS or xNAME, we could get into this place with
qry == NULL, and we'd crash when trying to use the memory pool.
Let's simply use the stack instead.
Vladimír Čunát [Fri, 15 Nov 2019 12:22:11 +0000 (13:22 +0100)]
daemon/udp_queue: add a ref-unref pair
I must admit I don't really understand why we had a rare case
of use-after-free in the sendmmsg call, but this change should avoid
that without affecting anything else.
Tomas Krizek [Fri, 8 Nov 2019 12:18:43 +0000 (13:18 +0100)]
meson: remove upper version limit for knot
The advanced version comparison was isn't implemeted in meson 0.46,
which is used for CentOS 7 and it caused build issue with development
version of Knot.