From: Mathieu Desnoyers Date: Tue, 16 Jul 2013 01:15:05 +0000 (-0400) Subject: document metadata_switch_timer() deadlock X-Git-Tag: v2.3.0-rc1~17 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=4fa3dc0ebca381a211ace01c3320591529b5b833;p=lttng-tools.git document metadata_switch_timer() deadlock Reviewed-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index f2dff4cd9..a32dbf64d 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -78,6 +78,22 @@ static void metadata_switch_timer(struct lttng_consumer_local_data *ctx, switch (ctx->type) { case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: + /* + * Locks taken by lttng_ustconsumer_request_metadata(): + * - metadata_socket_lock + * - Calling lttng_ustconsumer_recv_metadata(): + * - consumer_data.lock + * - channel->lock + * - channel->metadata_cache->lock + * - Calling consumer_metadata_cache_flushed(): + * - consumer_data.lock + * - channel->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. + */ ret = lttng_ustconsumer_request_metadata(ctx, channel); if (ret < 0) { channel->switch_timer_error = 1;