]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Hold a catz reference while the update process is running
authorAram Sargsyan <aram@isc.org>
Tue, 21 Mar 2023 11:42:28 +0000 (11:42 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 21 Mar 2023 11:47:17 +0000 (11:47 +0000)
This should delay the catalog zone from being destroyed during
shutdown, if the update process is still running.

Doing this should not introduce significant shutdown delays, as
the update function constantly checks the 'shuttingdown' flag
and cancels the process if it is set.

(cherry picked from commit dc2b8bb1c970babe774dd32048ea182d74e8fb36)

lib/dns/catz.c

index 58942dcda9061c9f0a3dcb4ce36870427fcbd29b..f9397645e54bd7631f5fc1bcb2945d142c30659a 100644 (file)
@@ -2114,6 +2114,7 @@ dns__catz_timer_cb(isc_task_t *task, isc_event_t *event) {
                      ISC_LOG_INFO, "catz: %s: reload start", domain);
 
        dns_catz_ref_catzs(catz->catzs);
+       dns_catz_ref_catz(catz);
        isc_nm_work_offload(isc_task_getnetmgr(catz->catzs->updater),
                            dns__catz_update_cb, dns__catz_done_cb, catz);
 
@@ -2592,6 +2593,7 @@ done:
                      ISC_LOG_INFO, "catz: %s: reload done: %s", dname,
                      isc_result_totext(result));
 
+       dns_catz_unref_catz(catz);
        dns_catz_unref_catzs(catz->catzs);
 }