mirror of
https://github.com/netdata/netdata.git
synced 2025-05-21 16:27:14 +00:00
Fix coverity issues (#11809)
* Add check for NULL wc->host * Use sqlite3_exec, if it fails it will be retried on the next health log entries rotation
This commit is contained in:
parent
ceec6aec1d
commit
11b8588c94
2 changed files with 29 additions and 13 deletions
database/sqlite
|
@ -572,18 +572,24 @@ void aclk_receive_chart_reset(struct aclk_database_worker_config *wc, struct acl
|
|||
wc->chart_payload_count = 0;
|
||||
|
||||
RRDHOST *host = wc->host;
|
||||
rrdhost_rdlock(host);
|
||||
RRDSET *st;
|
||||
rrdset_foreach_read(st, host) {
|
||||
rrdset_rdlock(st);
|
||||
rrdset_flag_clear(st, RRDSET_FLAG_ACLK);
|
||||
RRDDIM *rd;
|
||||
rrddim_foreach_read(rd, st) {
|
||||
rd->state->aclk_live_status = (rd->state->aclk_live_status == 0);
|
||||
if (likely(host)) {
|
||||
rrdhost_rdlock(host);
|
||||
RRDSET *st;
|
||||
rrdset_foreach_read(st, host)
|
||||
{
|
||||
rrdset_rdlock(st);
|
||||
rrdset_flag_clear(st, RRDSET_FLAG_ACLK);
|
||||
RRDDIM *rd;
|
||||
rrddim_foreach_read(rd, st)
|
||||
{
|
||||
rd->state->aclk_live_status = (rd->state->aclk_live_status == 0);
|
||||
}
|
||||
rrdset_unlock(st);
|
||||
}
|
||||
rrdset_unlock(st);
|
||||
rrdhost_unlock(host);
|
||||
}
|
||||
rrdhost_unlock(host);
|
||||
else
|
||||
error_report("ACLK synchronization thread for %s is not linked to HOST", wc->host_guid);
|
||||
}
|
||||
else {
|
||||
log_access("AC [%s (%s)]: Restarting chart sync from sequence %"PRIu64, wc->node_id, wc->host ? wc->host->hostname : "N/A", cmd.param1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue