consumerd: on_sleep not called on stream when no data is available
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Jun 2020 22:27:52 +0000 (18:27 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 17 Jun 2020 22:27:52 +0000 (18:27 -0400)
The `on_sleep` stream operation is not invoked when a stream's `get`
operation returns ENODATA (no data available).

Since this is not an error, the normal steps of the consumption loops
should be assumed.

Not marked as a fix as this is not problematic right now. However, it
could prove misleading in the future.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I0812e3af4c967390ebba4128781787abf45c76a1

src/common/consumer/consumer.c

index 50951fd28db4f645e9ec1c75e6984193a7416d10..cbd99e7ec3ab08146142706383085b2933e314ba 100644 (file)
@@ -3347,6 +3347,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                if (ret == -ENODATA) {
                        /* Not an error. */
                        ret = 0;
+                       goto sleep_stream;
                }
                goto end;
        }
@@ -3412,6 +3413,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                goto end;
        }
 
+stream_sleep:
        if (stream->read_subbuffer_ops.on_sleep) {
                stream->read_subbuffer_ops.on_sleep(stream, ctx);
        }
This page took 0.02775 seconds and 5 git commands to generate.