diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-05-25 11:31:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-25 11:31:41 +0300 |
commit | bf85ce801417edff5fe7e9eb6bfae0caba34b41e (patch) | |
tree | a8888a7a72c64e4dc2cd07cef9703943dc3b6046 /streaming/receiver.c | |
parent | 6fa912c0d6888cbe8f5c03843206f213c2559312 (diff) |
Delay children chart obsoletion check (#12992)
* wait untill after 2 minutes of last chart received to run obsoletion check
* turn write to read locks
Diffstat (limited to 'streaming/receiver.c')
-rw-r--r-- | streaming/receiver.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/streaming/receiver.c b/streaming/receiver.c index 87f96039dc..4685f6bcd2 100644 --- a/streaming/receiver.c +++ b/streaming/receiver.c @@ -671,7 +671,9 @@ static int rrdpush_receive(struct receiver_state *rpt) rpt->host->hostname); } } - rpt->host->trigger_chart_obsoletion_check = now_realtime_sec(); + rpt->host->senders_connect_time = now_realtime_sec(); + rpt->host->senders_last_chart_command = 0; + rpt->host->trigger_chart_obsoletion_check = 1; rrdhost_unlock(rpt->host); // call the plugins.d processor to receive the metrics @@ -707,12 +709,13 @@ static int rrdpush_receive(struct receiver_state *rpt) rrdhost_wrlock(rpt->host); netdata_mutex_lock(&rpt->host->receiver_lock); if (rpt->host->receiver == rpt) { + rpt->host->senders_connect_time = 0; + rpt->host->trigger_chart_obsoletion_check = 0; rpt->host->senders_disconnected_time = now_realtime_sec(); rrdhost_flag_set(rpt->host, RRDHOST_FLAG_ORPHAN); if(health_enabled == CONFIG_BOOLEAN_AUTO) rpt->host->health_enabled = 0; } - rpt->host->trigger_chart_obsoletion_check = 0; rrdhost_unlock(rpt->host); if (rpt->host->receiver == rpt) { rrdpush_sender_thread_stop(rpt->host); |