Merge branch '4015-fix-forward_cancel-from-the-wrong-loop' into 'main'

Run the forward_cancel on the appropriate zone->loop

Closes #4015

See merge request isc-projects/bind9!7835
This commit is contained in:
Ondřej Surý 2023-04-14 15:13:03 +00:00
commit 02edb42a0a
2 changed files with 16 additions and 1 deletions

View file

@ -1,3 +1,9 @@
6150. [bug] If the zones have active upstream forwards, the
shutting down the server might cause assertion
failures as the forward were all canceled from
the main loop instead from the loops associated
with the zone. [GL #4015]
6149. [test] As a workaround, include an OpenSSL header file before
including cmocka.h in the unit tests, because OpenSSL
3.1.0 uses __attribute__(malloc), conflicting with a

View file

@ -11845,6 +11845,13 @@ checkds_cancel(dns_zone_t *zone) {
}
}
static void
forward_cancel_cb(void *arg) {
dns_request_t *request = arg;
dns_request_cancel(request);
dns_request_detach(&request);
}
static void
forward_cancel(dns_zone_t *zone) {
dns_forward_t *forward;
@ -11859,7 +11866,9 @@ forward_cancel(dns_zone_t *zone) {
forward = ISC_LIST_NEXT(forward, link))
{
if (forward->request != NULL) {
dns_request_cancel(forward->request);
dns_request_t *request = NULL;
dns_request_attach(forward->request, &request);
isc_async_run(zone->loop, forward_cancel_cb, request);
}
}
}