diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-17 09:30:20 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-10-17 09:30:20 +0000 |
commit | 386ccdd61e8256c8b21ee27ee2fc12438fc5ca98 (patch) | |
tree | c9fbcacdb01f029f46133a5ba7ecd610c2bcb041 /daemon/service.c | |
parent | Adding upstream version 1.42.4. (diff) | |
download | netdata-386ccdd61e8256c8b21ee27ee2fc12438fc5ca98.tar.xz netdata-386ccdd61e8256c8b21ee27ee2fc12438fc5ca98.zip |
Adding upstream version 1.43.0.upstream/1.43.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemon/service.c')
-rw-r--r-- | daemon/service.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/daemon/service.c b/daemon/service.c index a25e2a26b..f7fe86e04 100644 --- a/daemon/service.c +++ b/daemon/service.c @@ -105,14 +105,11 @@ static bool svc_rrdset_archive_obsolete_dimensions(RRDSET *st, bool all_dimensio return done_all_dimensions; } -static void svc_rrdset_obsolete_to_archive(RRDSET *st) { - worker_is_busy(WORKER_JOB_ARCHIVE_CHART); - +static void svc_rrdset_obsolete_to_free(RRDSET *st) { if(!svc_rrdset_archive_obsolete_dimensions(st, true)) return; - rrdset_flag_set(st, RRDSET_FLAG_ARCHIVED); - rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE); + worker_is_busy(WORKER_JOB_FREE_CHART); rrdcalc_unlink_all_rrdset_alerts(st); @@ -130,10 +127,9 @@ static void svc_rrdset_obsolete_to_archive(RRDSET *st) { worker_is_busy(WORKER_JOB_SAVE_CHART); rrdset_save(st); } - - worker_is_busy(WORKER_JOB_FREE_CHART); - rrdset_free(st); } + + rrdset_free(st); } static void svc_rrdhost_cleanup_obsolete_charts(RRDHOST *host) { @@ -150,12 +146,15 @@ static void svc_rrdhost_cleanup_obsolete_charts(RRDHOST *host) { && st->last_updated.tv_sec + rrdset_free_obsolete_time_s < now && st->last_collected_time.tv_sec + rrdset_free_obsolete_time_s < now )) { - svc_rrdset_obsolete_to_archive(st); + svc_rrdset_obsolete_to_free(st); } else if(rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE_DIMENSIONS)) { rrdset_flag_clear(st, RRDSET_FLAG_OBSOLETE_DIMENSIONS); svc_rrdset_archive_obsolete_dimensions(st, false); } + else if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_OBSOLETE))) { + rrdhost_flag_set(host, RRDHOST_FLAG_PENDING_OBSOLETE_CHARTS); + } } rrdset_foreach_done(st); } |