summaryrefslogtreecommitdiffstats
path: root/daemon/main.c
diff options
context:
space:
mode:
authorvkalintiris <vasilis@netdata.cloud>2023-06-19 15:24:36 +0300
committerGitHub <noreply@github.com>2023-06-19 15:24:36 +0300
commitc76538e2f0ef4450e7c5f12b44f620d74fdcde47 (patch)
treed63dc35f6e16add9e8412f45ae725e98e863e214 /daemon/main.c
parente12b0d8aba023dced9f17d05d60cde440546a59a (diff)
Add two functions that allow someone to start/stop ML. (#15185)
* Add two functions that allow someone to start/stop ML. * Shutdown ML after stopping collector services * Remove unnecessary mutex from ml charts. There's already a spinlock that protects the chart when a someone calls rrdset_done(). * Use a lightweight spinlock instead of a mutext for ML dimensions.
Diffstat (limited to 'daemon/main.c')
-rw-r--r--daemon/main.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/daemon/main.c b/daemon/main.c
index cff6530f3f..15f6b1dd61 100644
--- a/daemon/main.c
+++ b/daemon/main.c
@@ -344,11 +344,6 @@ void netdata_cleanup_and_exit(int ret) {
webrtc_close_all_connections();
- delta_shutdown_time("disable ML detection and training threads");
-
- ml_stop_threads();
- ml_fini();
-
delta_shutdown_time("disable maintenance, new queries, new web requests, new streaming connections and aclk");
service_signal_exit(
@@ -377,6 +372,11 @@ void netdata_cleanup_and_exit(int ret) {
| SERVICE_STREAMING
, 3 * USEC_PER_SEC);
+ delta_shutdown_time("disable ML detection and training threads");
+
+ ml_stop_threads();
+ ml_fini();
+
delta_shutdown_time("stop context thread");
timeout = !service_wait_exit(