diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-01-11 17:45:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-11 17:45:25 +0200 |
commit | b00b62f0e784b5eb616868c60985292cb3a7239d (patch) | |
tree | 68f0475ef1f35ef06d596631ac67aa31dfb919d6 /ml/ml.cc | |
parent | db0eb4556d435c264210a7e9dbfe69cb016ef456 (diff) |
cancel ml threads on shutdown and join them on host free (#14240)
* cancel ml threads on shutdown and join them on host free
* mark them not running before joining them
Diffstat (limited to 'ml/ml.cc')
-rw-r--r-- | ml/ml.cc | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -156,7 +156,14 @@ void ml_start_anomaly_detection_threads(RRDHOST *RH) { void ml_stop_anomaly_detection_threads(RRDHOST *RH) { if (RH && RH->ml_host) { Host *H = reinterpret_cast<Host *>(RH->ml_host); - H->stopAnomalyDetectionThreads(); + H->stopAnomalyDetectionThreads(true); + } +} + +void ml_cancel_anomaly_detection_threads(RRDHOST *RH) { + if (RH && RH->ml_host) { + Host *H = reinterpret_cast<Host *>(RH->ml_host); + H->stopAnomalyDetectionThreads(false); } } |