]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
daemon/zimport: close transaction after importing batch
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 11 Apr 2022 10:14:50 +0000 (12:14 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 11 Apr 2022 10:14:50 +0000 (12:14 +0200)
I'm really sorry about this.  It's my regression in 5.5.0 (!1225)

Practical consequence was that the RW transaction was held open
until that instance did something with cache (and thus closed),
so any other instance would be frozen in the meantime if doing
anything non-read-only with cache (e.g. startup).
https://lists.nic.cz/hyperkitty/list/knot-resolver-users@lists.nic.cz/thread/6DOXXOA6ACEUBVYPUY3T2MLGIHWOMV6M/

NEWS
daemon/zimport.c

diff --git a/NEWS b/NEWS
index 4c42d5940079faa1df4f46d72b810bb53c8c3e64..5de0829f10e038e17d6d509c8221d6ad8d3ad49a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ Bugfixes
 --------
 - modules/dns64: fix incorrect packet writes for cached packets (#727, !1275)
 - xdp: make it work also with libknot 3.1 (#735, !1276)
+- prefill module: fix lockup when starting multiple idle instances (!1285)
 
 
 Knot Resolver 5.5.0 (2022-03-15)
index 6bea6811f9fa16c06e70d3e520f50e1c6f55e240..a523a64f9c784dc2a5a989af2a1b627926aa1b30 100644 (file)
@@ -426,6 +426,7 @@ static void zi_zone_process(uv_timer_t *timer)
        kr_timer_start(&stopwatch);
 
        int ret = trie_apply(z_import->rrsets, zi_rrset_import, z_import);
+       (void)kr_cache_commit(&the_worker->engine->resolver.cache); // RW transaction open
        if (ret == 0) {
                kr_log_info(PREFILL, "performance: validating and caching took %.3lf s\n",
                        kr_timer_elapsed(&stopwatch));