Fix: relayd: make viewer streams consider metadata sent
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 3 Sep 2015 21:17:28 +0000 (17:17 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 24 Sep 2015 02:26:03 +0000 (22:26 -0400)
The metadata stream does not use prev seq, and is therefore not sent to
viewers if we depend on prev seq. Use the metadata_received field
instead to achieve the same purpose: if a viewer try to attach to a
session that has not received metadata yet, it will get and error
(metadata stream cannot be found when attaching).

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c

index 90d0dbf1c7657973a7e1c0db4d7ca6c909ac1f59..a2cad39995415ec68f810e7fe30bce97eb4bf51a 100644 (file)
@@ -315,8 +315,14 @@ int make_viewer_streams(struct relay_session *session,
                        /*
                         * Stream has no data, don't consider it yet.
                         */
-                       if (stream->prev_seq == -1ULL) {
-                               goto next;
+                       if (stream->is_metadata) {
+                               if (!stream->metadata_received) {
+                                       goto next;
+                               }
+                       } else {
+                               if (stream->prev_seq == -1ULL) {
+                                       goto next;
+                               }
                        }
                        vstream = viewer_stream_get_by_id(stream->stream_handle);
                        if (!vstream) {
This page took 0.02685 seconds and 4 git commands to generate.