X-Git-Url: http://git.efficios.com/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-timer.c;h=641478697904e516df1feb7e5c214b814fd38fb0;hp=ef056d1188d69571f6131c89c34cf3d8f622d2a9;hb=4419b4fb187cb896a8e64bb97c5471240abca122;hpb=d4298c99f2fc4864cdabb3a90fed4d1117308a51 diff --git a/src/common/consumer-timer.c b/src/common/consumer-timer.c index ef056d118..641478697 100644 --- a/src/common/consumer-timer.c +++ b/src/common/consumer-timer.c @@ -61,17 +61,17 @@ static void metadata_switch_timer(struct lttng_consumer_local_data *ctx, channel = si->si_value.sival_ptr; assert(channel); + if (channel->switch_timer_error) { + return; + } + DBG("Switch timer for channel %" PRIu64, channel->key); switch (ctx->type) { case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: ret = lttng_ustconsumer_request_metadata(ctx, channel); if (ret < 0) { - /* - * An error means that we were unable to request the metadata to - * the session daemon so stop the timer for that channel. - */ - consumer_timer_switch_stop(channel); + channel->switch_timer_error = 1; } break; case LTTNG_CONSUMER_KERNEL: @@ -83,6 +83,8 @@ static void metadata_switch_timer(struct lttng_consumer_local_data *ctx, /* * Set the timer for periodical metadata flush. + * Should be called only from the recv cmd thread (single thread ensures + * mutual exclusion). */ void consumer_timer_switch_start(struct lttng_consumer_channel *channel, unsigned int switch_timer_interval) @@ -120,6 +122,8 @@ void consumer_timer_switch_start(struct lttng_consumer_channel *channel, /* * Stop and delete timer. + * Should be called only from the recv cmd thread (single thread ensures + * mutual exclusion). */ void consumer_timer_switch_stop(struct lttng_consumer_channel *channel) {