X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-timer.c;h=37c9861b906a0a81c6b08a302c73e486e6c6d3dd;hb=850767541647c102a299d7fbc39c97555ac70224;hp=f2dff4cd980aae5258cfc19a3c268bd800c955c8;hpb=d98a47c754f867bee113325ff69419f0829de0bb;p=lttng-tools.git diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index f2dff4cd9..37c9861b9 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -78,7 +78,21 @@ static void metadata_switch_timer(struct lttng_consumer_local_data *ctx, switch (ctx->type) { case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: - ret = lttng_ustconsumer_request_metadata(ctx, channel); + /* + * Locks taken by lttng_ustconsumer_request_metadata(): + * - metadata_socket_lock + * - Calling lttng_ustconsumer_recv_metadata(): + * - channel->metadata_cache->lock + * - Calling consumer_metadata_cache_flushed(): + * - channel->timer_lock + * - channel->metadata_cache->lock + * + * Ensure that neither consumer_data.lock nor + * channel->lock are taken within this function, since + * they are held while consumer_timer_switch_stop() is + * called. + */ + ret = lttng_ustconsumer_request_metadata(ctx, channel, 1); if (ret < 0) { channel->switch_timer_error = 1; }