mirror of
https://github.com/netdata/netdata.git
synced 2025-04-14 01:29:11 +00:00
Improve ml thread termination during agent shutdown (#17889)
* 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:
parent
03b138974e
commit
7450f4d7a1
1 changed files with 5 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue