From 87c4c24cdeb858decaf11232bd413a8a815b4732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Sur=C3=BD?= Date: Thu, 31 Mar 2022 22:15:49 +0200 Subject: [PATCH] Set quantum to infinity for the zone loading task When we are loading the zones, set the quantum to UINT_MAX, which makes task_run process all tasks at once. After the zone loading is finished the quantum will be dropped to 1 to not block server when we are loading new zones after reconfiguration. --- lib/dns/zone.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/dns/zone.c b/lib/dns/zone.c index 31443d6815..ceb915ed5c 100644 --- a/lib/dns/zone.c +++ b/lib/dns/zone.c @@ -2426,6 +2426,9 @@ zone_asyncload(isc_task_t *task, isc_event_t *event) { (asl->loaded)(asl->loaded_arg, zone, task); } + /* Reduce the quantum */ + isc_task_setquantum(zone->loadtask, 1); + isc_mem_put(zone->mctx, asl, sizeof(*asl)); dns_zone_idetach(&zone); } @@ -19167,7 +19170,7 @@ dns_zonemgr_setsize(dns_zonemgr_t *zmgr, int num_zones) { pool = NULL; if (zmgr->loadtasks == NULL) { result = isc_taskpool_create(zmgr->taskmgr, zmgr->mctx, ntasks, - 2, true, &pool); + UINT_MAX, true, &pool); } else { result = isc_taskpool_expand(&zmgr->loadtasks, ntasks, true, &pool);