Destroy the hashmap iterator inside the rwlock

Previously, the hashmap iterator for fetches-per-zone was destroy
outside the rwlock.  This could lead to an assertion failure due to a
timing race with the internal rehashing of the hashmap table as the
rehashing process requires no iterators to be running when rehashing the
hashmap table.  This has been fixed by moving the destruction of the
iterator inside the read locked section.
This commit is contained in:
Ondřej Surý 2025-02-25 12:13:56 +01:00
parent 24db1b1a8a
commit 1e4fb53c61
No known key found for this signature in database
GPG key ID: 2820F37E873DEA41

View file

@ -11048,8 +11048,8 @@ dns_resolver_dumpquota(dns_resolver_t *res, isc_buffer_t **buf) {
}
cleanup:
RWUNLOCK(&res->counters_lock, isc_rwlocktype_read);
isc_hashmap_iter_destroy(&it);
RWUNLOCK(&res->counters_lock, isc_rwlocktype_read);
return result;
}