Merge branch '84-destroy-task-first-when-destroying-rpzs' into 'master'
Destroy updater task first when destroying rpzs. Closes #84 See merge request isc-projects/bind9!944
This commit is contained in:
@@ -1,3 +1,6 @@
|
||||
5073. [bug] Destroy a task first when destroying rpzs and catzs.
|
||||
[GL #84]
|
||||
|
||||
5072. [bug] Add unit tests for isc_buffer_copyregion() and fix its
|
||||
behavior for auto-reallocated buffers. [GL #644]
|
||||
|
||||
|
||||
+2
-2
@@ -795,7 +795,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
|
||||
*catzsp = NULL;
|
||||
|
||||
if (isc_refcount_decrement(&catzs->refs) == 1) {
|
||||
isc_refcount_destroy(&catzs->refs);
|
||||
isc_task_destroy(&catzs->updater);
|
||||
DESTROYLOCK(&catzs->lock);
|
||||
if (catzs->zones != NULL) {
|
||||
isc_ht_iter_t *iter = NULL;
|
||||
@@ -815,7 +815,7 @@ dns_catz_catzs_detach(dns_catz_zones_t **catzsp) {
|
||||
INSIST(isc_ht_count(catzs->zones) == 0);
|
||||
isc_ht_destroy(&catzs->zones);
|
||||
}
|
||||
isc_task_destroy(&catzs->updater);
|
||||
isc_refcount_destroy(&catzs->refs);
|
||||
isc_mem_putanddetach(&catzs->mctx, catzs, sizeof(*catzs));
|
||||
}
|
||||
}
|
||||
|
||||
+7
-2
@@ -2148,7 +2148,12 @@ dns_rpz_detach_rpzs(dns_rpz_zones_t **rpzsp) {
|
||||
*rpzsp = NULL;
|
||||
|
||||
if (isc_refcount_decrement(&rpzs->refs) == 1) {
|
||||
isc_refcount_destroy(&rpzs->refs);
|
||||
/*
|
||||
* Destroy the task first, so that nothing runs
|
||||
* in the background that might race with us.
|
||||
*/
|
||||
isc_task_destroy(&rpzs->updater);
|
||||
|
||||
/*
|
||||
* Forget the last of view's rpz machinery after
|
||||
* the last reference.
|
||||
@@ -2178,7 +2183,7 @@ dns_rpz_detach_rpzs(dns_rpz_zones_t **rpzsp) {
|
||||
}
|
||||
DESTROYLOCK(&rpzs->maint_lock);
|
||||
isc_rwlock_destroy(&rpzs->search_lock);
|
||||
isc_task_destroy(&rpzs->updater);
|
||||
isc_refcount_destroy(&rpzs->refs);
|
||||
isc_mem_putanddetach(&rpzs->mctx, rpzs, sizeof(*rpzs));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user