Fix: missing lock/unlock when sending index
authorDavid Goulet <dgoulet@efficios.com>
Thu, 28 Nov 2013 18:22:26 +0000 (13:22 -0500)
committerDavid Goulet <dgoulet@efficios.com>
Thu, 28 Nov 2013 18:22:26 +0000 (13:22 -0500)
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 <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
src/common/consumer-stream.c

index 422dd0daa55929a7058e163977bcc05d7bba371e..745de050d6dd4f7c805d37ec2f1221092fed17ac 100644 (file)
@@ -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;
 
This page took 0.026276 seconds and 4 git commands to generate.