diff options
author | Emmanuel Vasilakis <mrzammler@mm.st> | 2021-11-22 20:58:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-22 20:58:05 +0200 |
commit | d13b918ad065528063c19d8d608ead180a923ead (patch) | |
tree | 09dfc367664885f997fb355c20864ede80cf582a /database | |
parent | c511d98c34f6cfde537f75ff71d5e1cb015ec45b (diff) |
Δont use wc στρθψτ if it may not exist (#11820)
Diffstat (limited to 'database')
-rw-r--r-- | database/sqlite/sqlite_aclk_alert.c | 10 | ||||
-rw-r--r-- | database/sqlite/sqlite_aclk_chart.c | 4 | ||||
-rw-r--r-- | database/sqlite/sqlite_aclk_node.c | 2 |
3 files changed, 8 insertions, 8 deletions
diff --git a/database/sqlite/sqlite_aclk_alert.c b/database/sqlite/sqlite_aclk_alert.c index f3d0355fa1..af2797a51b 100644 --- a/database/sqlite/sqlite_aclk_alert.c +++ b/database/sqlite/sqlite_aclk_alert.c @@ -304,7 +304,7 @@ void aclk_send_alarm_health_log(char *node_id) aclk_database_enq_cmd(wc, &cmd); else { if (aclk_worker_enq_cmd(node_id, &cmd)) - error_report("ACLK synchronization thread is not active for node id %s", node_id); + log_access("AC [%s (N/A)]: ACLK synchronization thread is not active.", node_id); } return; } @@ -515,7 +515,7 @@ int aclk_push_alert_config_event(struct aclk_database_worker_config *wc, struct destroy_aclk_alarm_configuration(&alarm_config); } else - info("Alert config for %s not found", config_hash); + log_access("AC [%s (%s)]: Alert config for %s not found.", wc->node_id, wc->host ? wc->host->hostname : "N/A", config_hash); bind_fail: rc = sqlite3_finalize(res); @@ -549,7 +549,7 @@ void aclk_start_alert_streaming(char *node_id, uint64_t batch_id, uint64_t start rrd_unlock(); if (unlikely(!host->health_enabled)) { - log_access("AC [%s (%s)]: Ignoring request to stream alert state changes, health is disabled.", node_id, wc->host ? wc->host->hostname : "N/A"); + log_access("AC [%s (N/A)]: Ignoring request to stream alert state changes, health is disabled.", node_id); return; } @@ -562,7 +562,7 @@ void aclk_start_alert_streaming(char *node_id, uint64_t batch_id, uint64_t start __sync_synchronize(); } else - log_access("AC [%s (%s)]: ACLK synchronization thread is not active.", node_id, wc->host ? wc->host->hostname : "N/A"); + log_access("AC [%s (N/A)]: ACLK synchronization thread is not active.", node_id); #else UNUSED(node_id); @@ -648,7 +648,7 @@ void aclk_process_send_alarm_snapshot(char *node_id, char *claim_id, uint64_t sn cmd.completion = NULL; aclk_database_enq_cmd(wc, &cmd); } else - error("ACLK synchronization thread is not active for host %s", host->hostname); + log_access("AC [%s (N/A)]: ACLK synchronization thread is not active.", node_id); #else UNUSED(node_id); UNUSED(snapshot_id); diff --git a/database/sqlite/sqlite_aclk_chart.c b/database/sqlite/sqlite_aclk_chart.c index 98cfbb597e..4b887abaa7 100644 --- a/database/sqlite/sqlite_aclk_chart.c +++ b/database/sqlite/sqlite_aclk_chart.c @@ -647,7 +647,7 @@ static void aclk_submit_param_command(char *node_id, enum aclk_database_opcode a aclk_database_enq_cmd(wc, &cmd); else { if (aclk_worker_enq_cmd(node_id, &cmd)) - log_access("AC [%s (%s)]: ACLK synchronization thread is not active.", node_id, host ? host->hostname : "N/A"); + log_access("AC [%s (N/A)]: ACLK synchronization thread is not active.", node_id); } return; } @@ -727,7 +727,7 @@ void aclk_start_streaming(char *node_id, uint64_t sequence_id, time_t created_at } } else - log_access("AC [%s (%s)]: ACLK synchronization thread is not active.", wc->node_id, wc->host ? wc->host->hostname : "N/A"); + log_access("AC [%s (N/A)]: ACLK synchronization thread is not active.", node_id); return; } host = host->next; diff --git a/database/sqlite/sqlite_aclk_node.c b/database/sqlite/sqlite_aclk_node.c index 47b7f0afd3..ba498c2a78 100644 --- a/database/sqlite/sqlite_aclk_node.c +++ b/database/sqlite/sqlite_aclk_node.c @@ -52,7 +52,7 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat node_info.data.host_labels_head = labels->head; aclk_update_node_info(&node_info); - log_access("OG [%s (%s)]: Sending node info for guid [%s] (%s).", wc->node_id, wc->host ? wc->host->hostname : "N/A", wc->host_guid, wc->host == localhost ? "parent" : "child"); + log_access("OG [%s (%s)]: Sending node info for guid [%s] (%s).", wc->node_id, wc->host->hostname, wc->host_guid, wc->host == localhost ? "parent" : "child"); netdata_rwlock_unlock(&labels->labels_rwlock); rrd_unlock(); |