From: Mathieu Desnoyers Date: Thu, 3 Sep 2015 21:17:28 +0000 (-0400) Subject: Fix: relayd: make viewer streams consider metadata sent X-Git-Tag: v2.7.0-rc2~86 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=6b7ee9c9dc5d733a4fac260d3dcc9831bf09c620;p=lttng-tools.git Fix: relayd: make viewer streams consider metadata sent 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index aa0586814..6f69b1058 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -316,8 +316,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) {