X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fconsumer-stream.c;h=5b52862c70a4a1d57fde1237e4f5e5ac6d1033cc;hp=745de050d6dd4f7c805d37ec2f1221092fed17ac;hb=6d574024f868e661ae688ecbc47a110a1311c57e;hpb=d02b8372bf598bcd71a42823e3beabdeba1b0281 diff --git a/src/common/consumer-stream.c b/src/common/consumer-stream.c index 745de050d..5b52862c7 100644 --- a/src/common/consumer-stream.c +++ b/src/common/consumer-stream.c @@ -122,7 +122,29 @@ void consumer_stream_close(struct lttng_consumer_stream *stream) break; case LTTNG_CONSUMER32_UST: case LTTNG_CONSUMER64_UST: + { + /* + * Special case for the metadata since the wait fd is an internal pipe + * polled in the metadata thread. + */ + if (stream->metadata_flag && stream->chan->monitor) { + int rpipe = stream->ust_metadata_poll_pipe[0]; + + /* + * This will stop the channel timer if one and close the write side + * of the metadata poll pipe. + */ + lttng_ustconsumer_close_metadata(stream->chan); + if (rpipe >= 0) { + ret = close(rpipe); + if (ret < 0) { + PERROR("closing metadata pipe write side"); + } + stream->ust_metadata_poll_pipe[0] = -1; + } + } break; + } default: ERR("Unknown consumer_data type"); assert(0); @@ -195,9 +217,11 @@ void consumer_stream_delete(struct lttng_consumer_stream *stream, rcu_read_unlock(); - /* Decrement the stream count of the global consumer data. */ - assert(consumer_data.stream_count > 0); - consumer_data.stream_count--; + if (!stream->metadata_flag) { + /* Decrement the stream count of the global consumer data. */ + assert(consumer_data.stream_count > 0); + consumer_data.stream_count--; + } } /*