Skip to content

Commit

Permalink
cleanup hosts - leftover code (netdata#19603)
Browse files Browse the repository at this point in the history
  • Loading branch information
ktsaou authored Feb 10, 2025
1 parent 1f7116c commit 4610ff0
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/database/rrdhost.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,26 +814,22 @@ void rrdhost_cleanup_data_collection_and_health(RRDHOST *host) {
void rrdhost_free___while_having_rrd_wrlock(RRDHOST *host) {
if(!host) return;

if (netdata_exit) {
nd_log(NDLS_DAEMON, NDLP_DEBUG,
"RRD: 'host:%s' freeing memory...",
rrdhost_hostname(host));
nd_log(NDLS_DAEMON, NDLP_DEBUG,
"RRD: 'host:%s' freeing memory...",
rrdhost_hostname(host));

// ------------------------------------------------------------------------
// first remove it from the indexes, so that it will not be discoverable
// ------------------------------------------------------------------------
// first remove it from the indexes, so that it will not be discoverable

rrdhost_index_del_hostname(host);
rrdhost_index_del_by_guid(host);
rrdhost_index_del_hostname(host);
rrdhost_index_del_by_guid(host);

if (host->prev)
DOUBLE_LINKED_LIST_REMOVE_ITEM_UNSAFE(localhost, host, prev, next);
}
if (host->prev)
DOUBLE_LINKED_LIST_REMOVE_ITEM_UNSAFE(localhost, host, prev, next);

// ------------------------------------------------------------------------

rrdhost_cleanup_data_collection_and_health(host);
if (!netdata_exit)
return;

// ------------------------------------------------------------------------
// free it
Expand Down

0 comments on commit 4610ff0

Please sign in to comment.