]> 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 09:56:36 +0000 (09:56 +0000)
committerAram Sargsyan <aram@isc.org>
Tue, 21 Mar 2023 10:15:30 +0000 (10:15 +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.

lib/dns/catz.c

index 73d30b62a0d3a39a60c1d67f4043b7b0cd129c16..58cd369312aa536566a029b85c192c30bb7eb927 100644 (file)
@@ -2124,6 +2124,7 @@ dns__catz_timer_cb(void *arg) {
                      ISC_LOG_INFO, "catz: %s: reload start", domain);
 
        dns_catz_ref_catzs(catz->catzs);
+       dns_catz_ref_catz(catz);
        isc_work_enqueue(catz->loop, dns__catz_update_cb, dns__catz_done_cb,
                         catz);
 
@@ -2543,6 +2544,7 @@ dns__catz_done_cb(void *data) {
                      ISC_LOG_INFO, "catz: %s: reload done: %s", dname,
                      isc_result_totext(catz->updateresult));
 
+       dns_catz_unref_catz(catz);
        dns_catz_unref_catzs(catz->catzs);
 }