0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-14 01:29:11 +00:00

Improve ml thread termination during agent shutdown ()

* Signal ML to terminate first without waiting for the threads to terminate
Add additional check if we need to stop within the per host ML processing

* Check for SERVICE_COLLECTORS running for the PREDICTION thread

* Function void param

* Function void param
This commit is contained in:
Stelios Fragkakis 2024-06-14 18:49:44 +03:00 committed by GitHub
parent 03b138974e
commit 7450f4d7a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1220,7 +1220,7 @@ ml_detect_main(void *arg)
heartbeat_t hb;
heartbeat_init(&hb);
while (!Cfg.detection_stop) {
while (!Cfg.detection_stop && service_running(SERVICE_COLLECTORS)) {
worker_is_idle();
heartbeat_next(&hb, USEC_PER_SEC);
@ -1230,6 +1230,9 @@ ml_detect_main(void *arg)
if (!rh->ml_host)
continue;
if (!service_running(SERVICE_COLLECTORS))
break;
ml_host_detect_once((ml_host_t *) rh->ml_host);
}
rrd_rdunlock();
@ -1266,6 +1269,7 @@ ml_detect_main(void *arg)
}
}
}
Cfg.training_stop = true;
return NULL;
}