@cryptotaxi247 / netdata-1 / commits / fc86461e3

Fix repeating alert crash (#20186)

Fix repeating alert

Stelios Fragkakis committed Apr 28, 2025 at 01:15 UTC fc86461e36f5ecb1376737f93d3f6a46789e081f
1 file changed +4 -2
src/health/health_notifications.c
+4 -2
@@ -22,7 +22,8 @@ void health_alarm_wait_for_execution(ALARM_ENTRY *ae) {
22
23 int code = 0;
24
25 - if (!(ae->flags & HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS)) {
25 + bool in_process = ae->flags & HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS;
26 + if (!in_process) {
27 nd_log(NDLS_DAEMON, NDLP_ERR, "attempted to wait for the execution of alert that has not an execution in progress");
28 code = 128;
29 goto cleanup;
@@ -45,7 +46,8 @@ cleanup:
46 if(ae->exec_code != 0)
47 ae->flags |= HEALTH_ENTRY_FLAG_EXEC_FAILED;
48
48 - unlink_alarm_notify_in_progress(ae);
49 + if (in_process)
50 + unlink_alarm_notify_in_progress(ae);
51 }
52
53 void wait_for_all_notifications_to_finish_before_allowing_health_to_be_cleaned_up(void) {