From 3ccf4e9534b21320e7255a2fbc47404f60a3a7d3 Mon Sep 17 00:00:00 2001 From: David Goulet Date: Thu, 28 Nov 2013 13:22:26 -0500 Subject: [PATCH] Fix: missing lock/unlock when sending index This was creating out of order messages between the relayd and the consumer leading to undesired behaviour for the tracing session being streamed. Acked-by: Julien Desfossez Signed-off-by: David Goulet --- src/common/consumer-stream.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/consumer-stream.c b/src/common/consumer-stream.c index 422dd0daa..745de050d 100644 --- a/src/common/consumer-stream.c +++ b/src/common/consumer-stream.c @@ -342,8 +342,10 @@ int consumer_stream_write_index(struct lttng_consumer_stream *stream, rcu_read_lock(); relayd = consumer_find_relayd(stream->net_seq_idx); if (relayd) { + pthread_mutex_lock(&relayd->ctrl_sock_mutex); ret = relayd_send_index(&relayd->control_sock, index, stream->relayd_stream_id, stream->next_net_seq_num - 1); + pthread_mutex_unlock(&relayd->ctrl_sock_mutex); } else { ssize_t size_ret; -- 2.34.1