Skip to content

Commit

Permalink
Fix alert entry traversal when doing cleanup (netdata#19373)
Browse files Browse the repository at this point in the history
Fix ae traversal on cleanup
  • Loading branch information
stelfrag authored Jan 10, 2025
1 parent 8e127e7 commit f9512b1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/database/sqlite/sqlite_metadata.c
Original file line number Diff line number Diff line change
Expand Up @@ -1772,15 +1772,15 @@ static void after_metadata_hosts(uv_work_t *req, int status __maybe_unused)
struct scan_metadata_payload *data = req->data;
struct metadata_wc *wc = data->wc;

bool first = false;
bool first = true;
Word_t Index = 0;
Pvoid_t *Pvalue;
while ((Pvalue = JudyLFirstThenNext(wc->ae_DelJudyL, &Index, &first))) {
ALARM_ENTRY *ae = (ALARM_ENTRY *) Index;
if(!__atomic_load_n(&ae->pending_save_count, __ATOMIC_RELAXED)) {
health_alarm_log_free_one_nochecks_nounlink(ae);
(void) JudyLDel(&wc->ae_DelJudyL, Index, PJE0);
first = false;
first = true;
Index = 0;
}
}
Expand Down

0 comments on commit f9512b1

Please sign in to comment.