mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-29 05:28:00 +00:00
Merge branch '3801-reduce-memory-bloat-caused-by-delayed-view-detach' into 'main'
Detach the views in zone_shutdown(), not in zone_free() Closes #3801 See merge request isc-projects/bind9!7382
This commit is contained in:
commit
71f13b9ad9
4
CHANGES
4
CHANGES
@ -1,3 +1,7 @@
|
|||||||
|
6069. [bug] Detach from the view in zone_shutdown() to
|
||||||
|
release the memory held by the dead view
|
||||||
|
early. [GL #3801]
|
||||||
|
|
||||||
6068. [bug] Downloading a zone via TLS from a server which does
|
6068. [bug] Downloading a zone via TLS from a server which does
|
||||||
not negotiate "dot" ALPN token could crash BIND
|
not negotiate "dot" ALPN token could crash BIND
|
||||||
on shutdown. That has been fixed. [GL #3767]
|
on shutdown. That has been fixed. [GL #3767]
|
||||||
|
@ -6900,6 +6900,7 @@ add_keydata_zone(dns_view_t *view, const char *directory, isc_mem_t *mctx) {
|
|||||||
dns_zone_attach(pview->managed_keys,
|
dns_zone_attach(pview->managed_keys,
|
||||||
&view->managed_keys);
|
&view->managed_keys);
|
||||||
dns_zone_setview(pview->managed_keys, view);
|
dns_zone_setview(pview->managed_keys, view);
|
||||||
|
dns_zone_setviewcommit(pview->managed_keys);
|
||||||
dns_view_detach(&pview);
|
dns_view_detach(&pview);
|
||||||
dns_zone_synckeyzone(view->managed_keys);
|
dns_zone_synckeyzone(view->managed_keys);
|
||||||
return (ISC_R_SUCCESS);
|
return (ISC_R_SUCCESS);
|
||||||
|
@ -35,7 +35,9 @@ Feature Changes
|
|||||||
Bug Fixes
|
Bug Fixes
|
||||||
~~~~~~~~~
|
~~~~~~~~~
|
||||||
|
|
||||||
- None.
|
- A constant stream of zone additions and deletions via ``rndc reconfig`` could
|
||||||
|
cause increased memory consumption due to delayed cleaning of view memory.
|
||||||
|
This has been fixed. :gl:`#3801`
|
||||||
|
|
||||||
Known Issues
|
Known Issues
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
@ -1246,6 +1246,8 @@ zone_free(dns_zone_t *zone) {
|
|||||||
INSIST(zone->readio == NULL);
|
INSIST(zone->readio == NULL);
|
||||||
INSIST(zone->statelist == NULL);
|
INSIST(zone->statelist == NULL);
|
||||||
INSIST(zone->writeio == NULL);
|
INSIST(zone->writeio == NULL);
|
||||||
|
INSIST(zone->view == NULL);
|
||||||
|
INSIST(zone->prev_view == NULL);
|
||||||
|
|
||||||
if (zone->task != NULL) {
|
if (zone->task != NULL) {
|
||||||
isc_task_detach(&zone->task);
|
isc_task_detach(&zone->task);
|
||||||
@ -1253,12 +1255,6 @@ zone_free(dns_zone_t *zone) {
|
|||||||
if (zone->loadtask != NULL) {
|
if (zone->loadtask != NULL) {
|
||||||
isc_task_detach(&zone->loadtask);
|
isc_task_detach(&zone->loadtask);
|
||||||
}
|
}
|
||||||
if (zone->view != NULL) {
|
|
||||||
dns_view_weakdetach(&zone->view);
|
|
||||||
}
|
|
||||||
if (zone->prev_view != NULL) {
|
|
||||||
dns_view_weakdetach(&zone->prev_view);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Unmanaged objects */
|
/* Unmanaged objects */
|
||||||
while (!ISC_LIST_EMPTY(zone->setnsec3param_queue)) {
|
while (!ISC_LIST_EMPTY(zone->setnsec3param_queue)) {
|
||||||
@ -14737,6 +14733,15 @@ zone_shutdown(void *arg) {
|
|||||||
|
|
||||||
LOCK_ZONE(zone);
|
LOCK_ZONE(zone);
|
||||||
INSIST(zone != zone->raw);
|
INSIST(zone != zone->raw);
|
||||||
|
|
||||||
|
/* Detach the views early, we don't need them anymore */
|
||||||
|
if (zone->view != NULL) {
|
||||||
|
dns_view_weakdetach(&zone->view);
|
||||||
|
}
|
||||||
|
if (zone->prev_view != NULL) {
|
||||||
|
dns_view_weakdetach(&zone->prev_view);
|
||||||
|
}
|
||||||
|
|
||||||
if (linked) {
|
if (linked) {
|
||||||
isc_refcount_decrement(&zone->irefs);
|
isc_refcount_decrement(&zone->irefs);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user