0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-21 04:10:38 +00:00

Fix locking access to chart labels ()

No write lock required
This commit is contained in:
Stelios Fragkakis 2022-06-03 15:24:55 +03:00 committed by GitHub
parent 9f7ddf5fd6
commit b8958eb8ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View file

@ -1974,7 +1974,7 @@ void rrdset_finalize_labels(RRDSET *st)
replace_label_list(labels, new_labels);
}
netdata_rwlock_wrlock(&labels->labels_rwlock);
netdata_rwlock_rdlock(&labels->labels_rwlock);
struct label *lbl = labels->head;
while (lbl) {
sql_store_chart_label(st->chart_uuid, (int)lbl->label_source, lbl->key, lbl->value);

View file

@ -159,7 +159,7 @@ int aclk_add_chart_event(struct aclk_database_worker_config *wc, struct aclk_dat
chart_payload.id = strdupz(st->id);
struct label_index *labels = &st->state->labels;
netdata_rwlock_wrlock(&labels->labels_rwlock);
netdata_rwlock_rdlock(&labels->labels_rwlock);
struct label *label_list = labels->head;
struct label *chart_label = NULL;
while (label_list) {

View file

@ -76,7 +76,7 @@ void sql_build_node_info(struct aclk_database_worker_config *wc, struct aclk_dat
node_info.data.ml_info.ml_enabled = host->system_info->ml_enabled;
struct label_index *labels = &host->labels;
netdata_rwlock_wrlock(&labels->labels_rwlock);
netdata_rwlock_rdlock(&labels->labels_rwlock);
node_info.data.host_labels_head = labels->head;
aclk_update_node_info(&node_info);