On a metadata cache write failure, we now skip the metadata flushed
check or else an infinite loop could have been possible.
Acked-by: Julien Desfossez <julien.desfossez@efficios.com>
Acked-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: David Goulet <dgoulet@efficios.com>
if (ret < 0) {
/* Unable to handle metadata. Notify session daemon. */
ret_code = LTTCOMM_CONSUMERD_ERROR_METADATA;
+ /*
+ * Skip metadata flush on write error since the offset and len might
+ * not have been updated which could create an infinite loop below when
+ * waiting for the metadata cache to be flushed.
+ */
+ pthread_mutex_unlock(&channel->metadata_cache->lock);
+ pthread_mutex_unlock(&consumer_data.lock);
+ goto end_free;
}
pthread_mutex_unlock(&channel->metadata_cache->lock);
pthread_mutex_unlock(&consumer_data.lock);