From ad5c40d00a36ef0e9c21a5a1a0eaa513c89dc1f3 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Mon, 24 Jul 2017 16:06:18 -0400 Subject: [PATCH] Fix live-comm: only apply retry timeout for already seen inactive indexes. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Tested-by: Anton Smyk Signed-off-by: Jonathan Rajotte Signed-off-by: Jérémie Galarneau --- formats/lttng-live/lttng-live-comm.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/formats/lttng-live/lttng-live-comm.c b/formats/lttng-live/lttng-live-comm.c index c19cc646..a1c95bbc 100644 --- a/formats/lttng-live/lttng-live-comm.c +++ b/formats/lttng-live/lttng-live-comm.c @@ -1033,6 +1033,13 @@ retry: switch (be32toh(rp->status)) { case LTTNG_VIEWER_INDEX_INACTIVE: printf_verbose("get_next_index: inactive\n"); + + if (index->ts_cycles.timestamp_end == + be64toh(rp->timestamp_end)) { + /* Already seen this timestamp. */ + (void) poll(NULL, 0, ACTIVE_POLL_DELAY); + } + memset(index, 0, sizeof(struct packet_index)); index->ts_cycles.timestamp_end = be64toh(rp->timestamp_end); *stream_id = be64toh(rp->stream_id); -- 2.34.1