From 558cd39fb7504ea3e52fdba116718edb8018c59d Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Wed, 17 Jun 2020 18:27:52 -0400 Subject: [PATCH] consumerd: on_sleep not called on stream when no data is available MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 Cherry-pick difference: merge conflict on rotation. Simply deleted the rotation related code. Change-Id: Ic840361477d77eae387573a1bb0949636abe9b12 --- src/common/consumer/consumer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/common/consumer/consumer.c b/src/common/consumer/consumer.c index bae4c294b..8a2a0f9c9 100644 --- a/src/common/consumer/consumer.c +++ b/src/common/consumer/consumer.c @@ -3165,6 +3165,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; } @@ -3209,6 +3210,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream, } } +stream_sleep: if (stream->read_subbuffer_ops.on_sleep) { stream->read_subbuffer_ops.on_sleep(stream, ctx); } -- 2.34.1