0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-28 22:52:30 +00:00

Don't send alert events without wc->host ()

* if wc->host is null dont send events

* we will always have wc->host

* free claim_id
This commit is contained in:
Emmanuel Vasilakis 2022-03-30 13:39:38 +03:00 committed by GitHub
parent 41a40dc3a4
commit dcf9679b10
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -135,6 +135,11 @@ void aclk_push_alert_event(struct aclk_database_worker_config *wc, struct aclk_d
if (unlikely(!claim_id))
return;
if (unlikely(!wc->host)) {
freez(claim_id);
return;
}
BUFFER *sql = buffer_create(1024);
if (wc->alerts_start_seq_id != 0) {
@ -269,7 +274,7 @@ void aclk_push_alert_event(struct aclk_database_worker_config *wc, struct aclk_d
db_execute(buffer_tostring(sql));
} else {
if (log_first_sequence_id)
log_access("OG [%s (%s)]: Sent alert events, first sequence_id %"PRIu64", last sequence_id %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", log_first_sequence_id, log_last_sequence_id);
log_access("OG [%s (%s)]: Sent alert events, first sequence_id %"PRIu64", last sequence_id %"PRIu64, wc->node_id, wc->host->hostname, log_first_sequence_id, log_last_sequence_id);
log_first_sequence_id = 0;
log_last_sequence_id = 0;
}