X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Flive.c;h=1a30366606065d248f0aaf05f915c18701683322;hb=1a29977872e79eca9312cc8d410cf33f433e521b;hp=5877467c0d5598f0cbdc7481f08c144a0b7580b1;hpb=80516611b6f19201b1e173fb448935aca7a9e668;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 5877467c0..1a3036660 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -1142,10 +1142,19 @@ int viewer_get_new_streams(struct relay_connection *conn) goto send_reply; } + /* + * For any new stream, create it with LTTNG_VIEWER_SEEK_BEGINNING since + * that at this point the client is already attached to the session.Aany + * initial stream will have been created with the seek type at attach + * time (for now most readers use the LTTNG_VIEWER_SEEK_LAST on attach). + * Otherwise any event happening in a new stream between the attach and + * a call to viewer_get_new_streams will be "lost" (never received) from + * the viewer's point of view. + */ pthread_mutex_lock(&session->lock); ret = make_viewer_streams(session, conn->viewer_session, - LTTNG_VIEWER_SEEK_LAST, &nb_total, &nb_unsent, + LTTNG_VIEWER_SEEK_BEGINNING, &nb_total, &nb_unsent, &nb_created, &closed); if (ret < 0) { goto error_unlock_session; @@ -2027,7 +2036,7 @@ int viewer_get_metadata(struct relay_connection *conn) /* * Either this is the first time the metadata file is read, or a - * rotation of the corresponding relay stream has occured. + * rotation of the corresponding relay stream has occurred. */ if (!vstream->stream_file.handle && len > 0) { struct fs_handle *fs_handle;