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 (#12547)
* if wc->host is null dont send events * we will always have wc->host * free claim_id
This commit is contained in:
parent
41a40dc3a4
commit
dcf9679b10
1 changed files with 6 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue