mirror of
https://github.com/netdata/netdata.git
synced 2025-04-17 11:12:42 +00:00
Health_index (#6377)
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:
parent
ffa23129c0
commit
80b70d37f2
1 changed files with 12 additions and 6 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue