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)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 25 Jun 2020 17:09:03 +0000 (13:09 -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

Cherry-pick difference: merge conflict on rotation. Simply deleted the
rotation related code.

Change-Id: Ic840361477d77eae387573a1bb0949636abe9b12

src/common/consumer/consumer.c

index bae4c294bd6938ec09f4a5b22df2fa787a819f6b..8a2a0f9c93c8cea6d8f9c1b77725142ed1673227 100644 (file)
@@ -3165,6 +3165,7 @@ ssize_t lttng_consumer_read_subbuffer(struct lttng_consumer_stream *stream,
                if (ret == -ENODATA) {
                        /* Not an error. */
                        ret = 0;
                if (ret == -ENODATA) {
                        /* Not an error. */
                        ret = 0;
+                       goto sleep_stream;
                }
                goto end;
        }
                }
                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);
        }
        if (stream->read_subbuffer_ops.on_sleep) {
                stream->read_subbuffer_ops.on_sleep(stream, ctx);
        }
This page took 0.029481 seconds and 5 git commands to generate.