if (ret < 0) {
PERROR("write consumer quit");
}
+
+ DBG("Consumer flag that it should quit");
}
void lttng_consumer_sync_trace_file(struct lttng_consumer_stream *stream,
{
int ret;
+ DBG("Consumer destroying it. Closing everything.");
+
ret = close(ctx->consumer_error_socket);
if (ret) {
PERROR("close");
len = ctx->on_buffer_ready(stream, ctx);
/* It's ok to have an unavailable sub-buffer */
if (len < 0 && len != -EAGAIN && len != -ENODATA) {
- rcu_read_unlock();
- goto end;
+ /* Clean up stream from consumer and free it. */
+ lttng_poll_del(&events, stream->wait_fd);
+ consumer_del_metadata_stream(stream, metadata_ht);
} else if (len > 0) {
stream->data_read = 1;
}
len = ctx->on_buffer_ready(local_stream[i], ctx);
/* it's ok to have an unavailable sub-buffer */
if (len < 0 && len != -EAGAIN && len != -ENODATA) {
- goto end;
+ /* Clean the stream and free it. */
+ consumer_del_stream(local_stream[i], data_ht);
} else if (len > 0) {
local_stream[i]->data_read = 1;
}
len = ctx->on_buffer_ready(local_stream[i], ctx);
/* it's ok to have an unavailable sub-buffer */
if (len < 0 && len != -EAGAIN && len != -ENODATA) {
- goto end;
+ /* Clean the stream and free it. */
+ consumer_del_stream(local_stream[i], data_ht);
} else if (len > 0) {
local_stream[i]->data_read = 1;
}