summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
1b532a6)
Some more conditions applies to return if the metadata cache is indeed
flushed. If no metadata stream is found or the endpoint status is set to
something other than ACTIVE, this means the channel is being (or will
be) destroyed thus the metadata cache can't be updated so is indeed
"flushed".
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
#include "consumer-metadata-cache.h"
#include "consumer-metadata-cache.h"
+extern struct lttng_consumer_global_data consumer_data;
+
/*
* Extend the allocated size of the metadata cache. Called only from
* lttng_ustconsumer_write_metadata_cache.
/*
* Extend the allocated size of the metadata cache. Called only from
* lttng_ustconsumer_write_metadata_cache.
cache = channel->metadata_cache;
cache = channel->metadata_cache;
+ pthread_mutex_lock(&consumer_data.lock);
pthread_mutex_lock(&channel->metadata_cache->lock);
pthread_mutex_lock(&channel->metadata_cache->lock);
if (cache->rb_pushed >= offset) {
ret = 0;
if (cache->rb_pushed >= offset) {
ret = 0;
+ } else if (!channel->metadata_stream) {
+ /*
+ * Having no metadata stream means the channel is being destroyed so there
+ * is no cache to flush anymore.
+ */
+ ret = 0;
+ } else if (channel->metadata_stream->endpoint_status !=
+ CONSUMER_ENDPOINT_ACTIVE) {
+ /* An inactive endpoint means we don't have to flush anymore. */
+ ret = 0;
+ /* Still not completely flushed. */
pthread_mutex_unlock(&channel->metadata_cache->lock);
pthread_mutex_unlock(&channel->metadata_cache->lock);
+ pthread_mutex_unlock(&consumer_data.lock);