Cleanup: remove ignored flags from poll events bitmasks
[lttng-tools.git] / src / common / consumer / consumer.cpp
index 8326a8e391d64d7506fcab19a981558955fcfd0b..f97c119705451c1f2080e99327de6488e9283062 100644 (file)
@@ -383,6 +383,12 @@ void consumer_del_channel(struct lttng_consumer_channel *channel)
                consumer_timer_monitor_stop(channel);
        }
 
+       /*
+        * Send a last buffer statistics sample to the session daemon
+        * to ensure it tracks the amount of data consumed by this channel.
+        */
+       sample_and_send_channel_buffer_stats(channel);
+
        switch (the_consumer_data.type) {
        case LTTNG_CONSUMER_KERNEL:
                break;
@@ -2161,7 +2167,7 @@ void consumer_del_metadata_stream(struct lttng_consumer_stream *stream,
        consumer_stream_delete(stream, ht);
 
        /* Close down everything including the relayd if one. */
-       consumer_stream_close(stream);
+       consumer_stream_close_output(stream);
        /* Destroy tracer buffers of the stream. */
        consumer_stream_destroy_buffers(stream);
 
@@ -2422,9 +2428,8 @@ restart:
                                                        stream->wait_fd);
 
                                        /* Add metadata stream to the global poll events list */
-                                       lttng_poll_add(&events, stream->wait_fd,
-                                                       LPOLLIN | LPOLLPRI | LPOLLHUP);
-                               } else if (revents & (LPOLLERR | LPOLLHUP)) {
+                                       lttng_poll_add(&events, stream->wait_fd, LPOLLIN | LPOLLPRI);
+                               }else if (revents & (LPOLLERR | LPOLLHUP)) {
                                        DBG("Metadata thread pipe hung up");
                                        /*
                                         * Remove the pipe from the poll set and continue the loop
@@ -3014,8 +3019,8 @@ restart:
                                                                &chan->wait_fd_node);
                                                rcu_read_unlock();
                                                /* Add channel to the global poll events list */
-                                               lttng_poll_add(&events, chan->wait_fd,
-                                                               LPOLLERR | LPOLLHUP);
+                                               // FIXME: Empty flag on a pipe pollset, this might hang on FreeBSD.
+                                               lttng_poll_add(&events, chan->wait_fd, 0);
                                                break;
                                        case CONSUMER_CHANNEL_DEL:
                                        {
This page took 0.026217 seconds and 4 git commands to generate.