summaryrefslogtreecommitdiffstats
path: root/streaming/rrdpush.h
diff options
context:
space:
mode:
authorAndrew Moss <1043609+amoss@users.noreply.github.com>2020-06-04 18:24:04 +0200
committerGitHub <noreply@github.com>2020-06-04 18:24:04 +0200
commitea7d7ea31d2d48730ccaf37e1c96c43f6b255fa8 (patch)
treec2d35dbd066652613702c495f6ae04947accae88 /streaming/rrdpush.h
parentfecbb89d0c33e2bbe84aa14c0b3204cb60134218 (diff)
Fix Coverity defects 359164, 359165 and 358989. (#9268)
Removed uses of the host lock that could deadlock senders and replaced with the new fine-grained mutex.
Diffstat (limited to 'streaming/rrdpush.h')
-rw-r--r--streaming/rrdpush.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/streaming/rrdpush.h b/streaming/rrdpush.h
index bad63888b9..2f171a0e38 100644
--- a/streaming/rrdpush.h
+++ b/streaming/rrdpush.h
@@ -52,9 +52,9 @@ struct sender_state {
size_t send_attempts;
time_t last_sent_t;
size_t not_connected_loops;
- // metrics may be collected asynchronously
- // these synchronize all the threads willing the write to our sending buffer
- netdata_mutex_t mutex; // Guard access to buffer / build
+ // Metrics are collected asynchronously by collector threads calling rrdset_done_push(). This can also trigger
+ // the lazy creation of the sender thread - both cases (buffer access and thread creation) are guarded here.
+ netdata_mutex_t mutex;
struct circular_buffer *buffer;
BUFFER *build;
char read_buffer[512];