Fix: send_channel_monitor_pipe does not take the consumer socket lock
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 20:24:40 +0000 (15:24 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Feb 2018 22:58:55 +0000 (17:58 -0500)
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/consumer.c
src/bin/lttng-sessiond/main.c

index 5e723e9b3804e08335d3e16758486899ec79f83e..25194460645d377ad5d0680417629f1f69d2f40b 100644 (file)
@@ -1068,6 +1068,7 @@ int consumer_send_channel_monitor_pipe(struct consumer_socket *consumer_sock,
        memset(&msg, 0, sizeof(msg));
        msg.cmd_type = LTTNG_CONSUMER_SET_CHANNEL_MONITOR_PIPE;
 
+       pthread_mutex_lock(consumer_sock->lock);
        DBG3("Sending set_channel_monitor_pipe command to consumer");
        ret = consumer_send_msg(consumer_sock, &msg);
        if (ret < 0) {
@@ -1083,6 +1084,7 @@ int consumer_send_channel_monitor_pipe(struct consumer_socket *consumer_sock,
 
        DBG2("Channel monitoring pipe successfully sent");
 error:
+       pthread_mutex_unlock(consumer_sock->lock);
        return ret;
 }
 
index 3625bba0f2d6d1f64049984f5209626d5d1dfcb1..726c4e388c7a01669b068bc30d7de4f647a26549 100644 (file)
@@ -1270,6 +1270,7 @@ restart:
        if (!cmd_socket_wrapper) {
                goto error;
        }
+       cmd_socket_wrapper->lock = &consumer_data->lock;
 
        ret = consumer_send_channel_monitor_pipe(cmd_socket_wrapper,
                        consumer_data->channel_monitor_pipe);
This page took 0.0301 seconds and 4 git commands to generate.