Browse Source

fix_lock: Add the missing lock (#8780)

This PR adds the missing lock and fix a master shutdown during streaming.
thiagoftsm 4 years ago
parent
commit
4edec08f4e
1 changed files with 2 additions and 0 deletions
  1. 2 0
      collectors/plugins.d/plugins_d.c

+ 2 - 0
collectors/plugins.d/plugins_d.c

@@ -655,7 +655,9 @@ inline size_t pluginsd_process(RRDHOST *host, struct plugind *cd, FILE *fp, int
             if(!host->labels) {
                 host->labels = new_labels;
             } else {
+                rrdhost_rdlock(host);
                 replace_label_list(host, new_labels);
+                rrdhost_unlock(host);
             }
 
             new_labels = NULL;