Merge branch '3598-adb-quota-might-not-be-decremented' into 'main'

Resolve "ADB quota might not be decremented"

Closes #3598

See merge request isc-projects/bind9!6893
This commit is contained in:
Arаm Sаrgsyаn 2022-10-21 08:50:53 +00:00
commit 2bd3b452cf
3 changed files with 27 additions and 5 deletions

View file

@ -1,3 +1,7 @@
6001. [bug] Always call dns_adb_endudpfetch() after calling
dns_adb_beginudpfetch() for UDP queries in resolver.c,
in order to adjust back the quota. [GL #3598]
6000. [bug] Fix a startup issue on Solaris systems with many
(reportedly > 510) CPUs. Thanks to Stacey Marshall from
Oracle for deep investigation of the problem. [GL #3563]

View file

@ -43,3 +43,7 @@ Bug Fixes
- BIND would fail to start on Solaris-based systems with hundreds of CPUs. This
has been fixed. ISC would like to thank Stacey Marshall from Oracle for
bringing this problem to our attention. :gl:`#3563`
- In certain resolution scenarios quotas could be erroneously reached for
servers, including the configured forwarders, resulting in SERVFAIL answers
sent to the clients. This has been fixed. :gl:`#3598`

View file

@ -1427,11 +1427,11 @@ fctx_cancelquery(resquery_t **queryp, isc_time_t *finish, bool no_response,
}
dns_adb_adjustsrtt(fctx->adb, query->addrinfo, rtt, factor);
}
if ((query->options & DNS_FETCHOPT_TCP) == 0) {
/* Inform the ADB that we're ending a UDP fetch */
dns_adb_endudpfetch(fctx->adb, query->addrinfo);
}
if ((query->options & DNS_FETCHOPT_TCP) == 0) {
/* Inform the ADB that we're ending a UDP fetch */
dns_adb_endudpfetch(fctx->adb, query->addrinfo);
}
/*
@ -2316,7 +2316,7 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
resquery_senddone, resquery_response, query, &query->id,
&query->dispentry);
if (result != ISC_R_SUCCESS) {
goto cleanup_dispatch;
goto cleanup_udpfetch;
}
/* Connect the socket */
@ -2327,6 +2327,14 @@ fctx_query(fetchctx_t *fctx, dns_adbaddrinfo_t *addrinfo,
return (result);
cleanup_udpfetch:
if (!RESQUERY_CANCELED(query)) {
if ((query->options & DNS_FETCHOPT_TCP) == 0) {
/* Inform the ADB that we're ending a UDP fetch */
dns_adb_endudpfetch(fctx->adb, addrinfo);
}
}
cleanup_dispatch:
fctx_detach(&query->fctx);
@ -2335,6 +2343,12 @@ cleanup_dispatch:
}
cleanup_query:
LOCK(&fctx->bucket->lock);
if (ISC_LINK_LINKED(query, link)) {
atomic_fetch_sub_release(&fctx->nqueries, 1);
ISC_LIST_UNLINK(fctx->queries, query, link);
}
UNLOCK(&fctx->bucket->lock);
query->magic = 0;
dns_message_detach(&query->rmessage);