X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-relayd%2Fviewer-stream.c;h=a18f21ad74aeea16f836df60ae38f99d154ec12f;hb=90faeb9e9a0f2697f2ec0136a97a6eaa8f589e64;hp=67c452eec7d4264139f1134b1fcdd4bc2aa2d49c;hpb=c92b20c7f29cb7816669037a03d2d66e9f48898a;p=lttng-tools.git diff --git a/src/bin/lttng-relayd/viewer-stream.c b/src/bin/lttng-relayd/viewer-stream.c index 67c452eec..a18f21ad7 100644 --- a/src/bin/lttng-relayd/viewer-stream.c +++ b/src/bin/lttng-relayd/viewer-stream.c @@ -302,7 +302,15 @@ void viewer_stream_sync_tracefile_array_tail(struct relay_viewer_stream *vstream if (seq_tail == -1ULL) { seq_tail = 0; } - vstream->index_sent_seqcount = seq_tail; + + /* + * Move the index sent seqcount forward if it was lagging behind + * the new tail of the tracefile array. If the current + * index_sent_seqcount is already further than the tracefile + * array tail position, keep its current position. + */ + vstream->index_sent_seqcount = seq_tail > vstream->index_sent_seqcount ? + seq_tail : vstream->index_sent_seqcount; } /*