From: Jérémie Galarneau Date: Wed, 17 Jun 2020 22:27:52 +0000 (-0400) Subject: consumerd: on_sleep not called on stream when no data is available X-Git-Tag: v2.11.5~18 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=557e564e2803a98efc269c2986f544cc716eec2f;p=lttng-tools.git consumerd: on_sleep not called on stream when no data is available 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 Change-Id: I0812e3af4c967390ebba4128781787abf45c76a1 --- diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index 73ef56be2..1900704bd 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -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); }