Marek Vavruša [Thu, 4 Jan 2018 00:07:35 +0000 (16:07 -0800)]
allow access to cache object through context
this surfaces the struct kr_cache through context variable,
it doesn't implement any API or documented interface for it,
so I just added a tests for the struct presence and introspection
Petr Špaček [Wed, 3 Jan 2018 16:56:39 +0000 (17:56 +0100)]
CI: publish coverage only for master branch (on web)
Non-master branches must not overwrite results from master branch.
From now only master branch publishes results on Gitlab Pages.
Results for other branches can be downloaded from artifacts.
Petr Špaček [Fri, 22 Dec 2017 12:21:24 +0000 (13:21 +0100)]
CI coverage: merge test coverage data from parallel runs
We run tests in paralell so have to make sure that coverage tools
do not overwrite results from each run.
This is hacky because lcov tool insists on having gcno and gcda files
in the same place as original source, so we have to copy files
to workaround this.
Petr Špaček [Thu, 21 Dec 2017 09:09:11 +0000 (10:09 +0100)]
CI coverage: add missing Lua files to the report
Luacov does not know about files which were not loaded at all.
Script luacov_gen_empty.sh generates empty luacov stats for all files
which forces luacov to show all files.
Petr Špaček [Wed, 20 Dec 2017 11:47:10 +0000 (12:47 +0100)]
CI coverage: handle Lua code coverage properly
Luacov statistics contained paths to installed files instead of source
files that it was a mess. The stats are now rewritten using hacky
mapping (created from install commands produced by make).
Also, branch and function coverage for Lua was always zero so now it is
turned off not to confuse users.
kresd config for respdiff now enables luacov as well.
Marek Vavruša [Tue, 28 Nov 2017 00:42:08 +0000 (16:42 -0800)]
modules/http: added /trace endpoint for request log tracing, added tests
This leverages the HTTP interface to trace execution of individual
requests. This is helpful for troubleshooting problems with a specific instance,
or to generate test files (as it writes out answers received).
Ideally it would also print a timeline of request processing broken down by
function (or layer) and the amount of time spent, but there's no
tracepoint for that yet.
Marek Vavruša [Mon, 27 Nov 2017 23:02:35 +0000 (15:02 -0800)]
lib: added support for trace_log for verbose messages
The `QRVERBOSE` macro uses the `query` pointer to find out whether the
request has trace log enabled. If it does, it uses trace log to log verbose messages using that callback (regardless of whether verbose mode is set or not).
This required changing of structure printing functions to formatting functions returning textual representation of the objects (dname, rrset, pkt).
This is potentially slower as creates heap objects, but it doesn't happen
in the hotpath so it doesn't really matter for verbose logs.
Marek Vavruša [Mon, 27 Nov 2017 22:59:55 +0000 (14:59 -0800)]
lib/rplan: remember request context in each query
This doesn't affect any of the objects lifetime, just provides a
convenience for logging as some subsystems take only pointer of queries
not the request object.
Marek Vavruša [Mon, 27 Nov 2017 22:19:10 +0000 (14:19 -0800)]
lib/resolve: add support for per-request logging
This is useful in many troubleshooting scenarios when you want debug logs
just for a single request. It's going to expand on TRACE flag functionality
in the next PRs, so that special requests can be invoked with various tracers attached.
Currently this is only available in the C modules that can set the callback,
it's not called anywhere in the library yet.
Petr Špaček [Fri, 8 Dec 2017 13:22:15 +0000 (14:22 +0100)]
daemon: add missing RR type definitions
Some RR type definitions present in IANA DNS parameters registry were
missing in kresd. This commit synchronizes the tables with IANA registry
as of 2017-12-08 13:20 UTC.
At the same time, this commit is
fixup! converted constant tables, support kres.type.TYPE1234
The mentioned commit accidentally removed NULL definition which broke TA
signaling module.
Petr Špaček [Thu, 7 Dec 2017 16:45:58 +0000 (17:45 +0100)]
rplan: fix kr_qflags_*() to work with more than 32 flags
Originally division around sizeof(uint32_t) caused silent truncation
for struct kr_qflags with sizes not multiple of 4 bytes.
Attempts to optimize using uint32_t blocks could lead to read/write
beyond end of uint32_t so I'm not willing to risk it.
Also, the code was refactored to avoid duplication between _set and _clear.
Quick look into assembly produced by gcc 7.2.1 with -O2 on x86_64 confirms that
all auxiliary functions got inlined so there are not extra function calls.
Unit tests are attached. These fail on the previous version of _set() and
_clear() and work now.
Petr Špaček [Thu, 7 Dec 2017 08:37:26 +0000 (09:37 +0100)]
CI: use Knot DNS 2.6 instead of master
Hopefully this will make build more reliable because breakage in Knot
DNS master will not affect us. On the other hand, we must not forget to
update Knot DNS in the image!
Vítězslav Kříž [Mon, 4 Dec 2017 14:15:33 +0000 (15:15 +0100)]
hints: server stop when root hints load failed
If user provides custom hints file with config option hints.root_file('file')
resovler fail with error. Before it just silently pass and may fail
when loading defaults file, which leads to confusing error message.
Petr Špaček [Fri, 1 Dec 2017 20:30:58 +0000 (21:30 +0100)]
fixup! client: move sources into separate directory
Previous cleanup attempt broke installation on systems without libedit.
client-install has to be defined at least as .PHONY target.
(I want to avoid if spagethi outside of client.mk.)
Petr Špaček [Fri, 1 Dec 2017 13:00:36 +0000 (14:00 +0100)]
client: move sources into separate directory
Let's not mix daemon and client files as client might grow to multiple
files in future. This will also help with upcomming changes to packaging
scripts.