0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-17 11:12:42 +00:00

Health_index ()

Inside rrdcalc_unlink_and_free I wrote a not proper way to check the presence
of an element inside the AVL, so I was raising an error without to do the correct checks!
This commit is contained in:
thiagoftsm 2019-07-05 10:45:17 +00:00 committed by Chris Akritidis
parent ffa23129c0
commit 80b70d37f2

View file

@ -438,14 +438,20 @@ void rrdcalc_unlink_and_free(RRDHOST *host, RRDCALC *rc) {
}
if (rc) {
RRDCALC *rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index");
RRDCALC *rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_health_log, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from health_log");
}
}
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index");
rdcmp = (RRDCALC *) avl_search_lock(&(host)->alarms_idx_name, (avl *)rc);
if (rdcmp) {
rdcmp = (RRDCALC *) avl_remove_lock(&(host)->alarms_idx_name, (avl *)rc);
if (!rdcmp) {
error("Cannot remove the health alarm index from idx_name");
}
}
}