]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Set quantum to infinity for the zone loading task
authorOndřej Surý <ondrej@isc.org>
Thu, 31 Mar 2022 20:15:49 +0000 (22:15 +0200)
committerOndřej Surý <ondrej@isc.org>
Fri, 1 Apr 2022 21:45:23 +0000 (23:45 +0200)
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

index 31443d68157bc8dd59e9c4e5be96c28534612e05..ceb915ed5c838a0d50f6dee5c5ac89a9e89bfdf0 100644 (file)
@@ -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);