Fix deadlock: don't take channel lock in timer
[lttng-tools.git] / src / common / consumer-timer.c
index a32dbf64d2d229e730f6e87a4add490c75567a39..d6b5648b71acc0b5933f2b4eedcb91f08b439dbf 100644 (file)
@@ -86,15 +86,15 @@ static void metadata_switch_timer(struct lttng_consumer_local_data *ctx,
                 *       - channel->lock
                 *         - channel->metadata_cache->lock
                 *     - Calling consumer_metadata_cache_flushed():
-                *       - consumer_data.lock
-                *         - channel->lock
-                *           - channel->metadata_cache->lock
+                *       - channel->timer_lock
+                *         - channel->metadata_cache->lock
                 *
-                * Both consumer_data.lock and channel->lock currently
-                * cause a deadlock, since they are held while
-                * consumer_timer_switch_stop() is called.
+                * 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);
+               ret = lttng_ustconsumer_request_metadata(ctx, channel, 1);
                if (ret < 0) {
                        channel->switch_timer_error = 1;
                }
This page took 0.023953 seconds and 4 git commands to generate.