diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2022-11-25 12:00:55 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-25 12:00:55 +0200 |
commit | d628eecf9d2a6ecb047dae8e1517999c5be63ba8 (patch) | |
tree | b7189dd3113e288b22dd7f761f79ec28bba09617 | |
parent | 37e9b1aed84dd2c2883799b925a85c46cad22a21 (diff) |
Don't let slow disk plugin thread delay shutdown (#14044)
* dont sleep for all duration of step
* empty line
-rw-r--r-- | collectors/diskspace.plugin/plugin_diskspace.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/collectors/diskspace.plugin/plugin_diskspace.c b/collectors/diskspace.plugin/plugin_diskspace.c index 83065d7f17..5f610983b7 100644 --- a/collectors/diskspace.plugin/plugin_diskspace.c +++ b/collectors/diskspace.plugin/plugin_diskspace.c @@ -511,12 +511,19 @@ void *diskspace_slow_worker(void *ptr) netdata_thread_cleanup_push(diskspace_slow_worker_cleanup, data->slow_thread); usec_t step = slow_update_every * USEC_PER_SEC; + usec_t real_step = USEC_PER_SEC; heartbeat_t hb; heartbeat_init(&hb); while(!netdata_exit) { worker_is_idle(); - heartbeat_next(&hb, step); + heartbeat_next(&hb, USEC_PER_SEC); + + if (real_step < step) { + real_step += USEC_PER_SEC; + continue; + } + real_step = USEC_PER_SEC; usec_t start_time = now_monotonic_high_precision_usec(); |