Fix: set_relayd_for_snapshot does not acquire the consumer socket lock
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.c
index 1adb27f26b4b508925ff70b3c97cbf85ba093240..731040a3c6c9e157ec2fe9f9b91268ae4fdbccf6 100644 (file)
@@ -3610,10 +3610,12 @@ static int set_relayd_for_snapshot(struct consumer_output *consumer,
        rcu_read_lock();
        cds_lfht_for_each_entry(snap_output->consumer->socks->ht, &iter.iter,
                        socket, node.node) {
+               pthread_mutex_lock(socket->lock);
                ret = send_consumer_relayd_sockets(0, session->id,
                                snap_output->consumer, socket,
                                session->name, session->hostname,
                                session->live_timer);
+               pthread_mutex_unlock(socket->lock);
                if (ret != LTTNG_OK) {
                        rcu_read_unlock();
                        goto error;
This page took 0.025003 seconds and 4 git commands to generate.