Marek Vavruša [Wed, 13 May 2015 09:52:16 +0000 (11:52 +0200)]
lib/layer: answer both m12n/full names from cache
previously only queried names were resolved from cache, this meant that if the target name was present in cache but a server on the search path dropped from it, it would refetch it - this is a problem when a loadbalancer with very short TTL was in search path
Marek Vavruša [Sun, 10 May 2015 19:38:00 +0000 (21:38 +0200)]
lib/resolve: fixed good cached ns expired, only bad remain
the resolution has to start from the root for zonecut resolution, otherwise it might stall resolution if the only good NS drops out of cache and only the bad remain
Marek Vavruša [Tue, 5 May 2015 21:21:49 +0000 (23:21 +0200)]
daemon/io: fixed corrupted handles with exhausted TCP clients
the TCP allowed parallel processing of multiple requests over
one client socket, however if the client socket disconnected,
it left the running tasks reading from bad handle
now each task takes ownership of the handle until it is finished,
only then it is returned to the loop and closed
Marek Vavruša [Sun, 3 May 2015 18:21:17 +0000 (20:21 +0200)]
lib/resolve: produce() layers can generate answer, not just query
previously producers in overlay could only generate query or
update the final answer - this required exported callbacks
from iterate.c and specific processing. this wouldn’t work
for negative cache, as it would be required to reimplement
whole iterate layer for cached data
the new workflow allows produce layers to generate answer
instead, this answer is then consumed in the next step
by the iterate module in unified fashion for all caches/generators
Marek Vavruša [Fri, 1 May 2015 15:51:09 +0000 (17:51 +0200)]
daemon/engine: extensible registry of cache backends
the engine keeps an array of storage backends available
for caching, it is possible to switch the backend on
runtime with standard ‘proto://config' string
Marek Vavruša [Fri, 1 May 2015 00:20:46 +0000 (02:20 +0200)]
lib/cache: relaxed API to allow other assets than RR
each asset is tagged by a byte defining its type and importance
this is a groundwork for negative cache and packet cache
abstracted the code in preparation for different backends
Marek Vavruša [Tue, 28 Apr 2015 16:59:43 +0000 (18:59 +0200)]
contrib: created 'contrib' directory with ccan/isaac as csprng
previously cryptolib random function was used to generate message id,
this works well but it is slow especially when the entropy is low,
replaced with cryptographically safe prng ISAAC
the ccan directory is going to be used in the future, as it's include
structure makes it easy to embed C snippets instead of reimplementing
them
Marek Vavruša [Fri, 24 Apr 2015 16:31:10 +0000 (18:31 +0200)]
daemon/worker: reworked multiplexed worker
* each query is assigned a task
* each task contains request, some primitives and mempool
* worker can process multiple tasks at once and
offload I/O to event loop
Not finished:
* it depends on icmp/system timeouts, #22
* tcp reads are going to be bad if the messages
arrive fragmented #21
Marek Vavruša [Sun, 26 Apr 2015 21:09:34 +0000 (23:09 +0200)]
lib/rplan: removed long-lived wr transactions
the reason is that LMDB allows only 1 write transaction
per thread, and this doesn’t work well with multiplexed
requests. there is probably going to be some performance hit,
but now transactions are scoped for each cache operation
the worker now creates a resolution context copy,
and keeps it if the query requires iterative queries.
the worker_exec() is now a reentrant function that gets
called with incoming data until the resolution is done,
and it sends the answer