Skip to contentSkip to conversation

Fix: get the stream_id when generating live beacons

PATCH Julien Desfossez 1 participant 1 message Jul 1, 2014 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Forget this patch, I'll send a new version soon.
Need to check the domain before...

Quoted 32 lines · Julien Desfossez

When we send an empty index (beacon), we need to extract the stream_id to avoid stalling the client on inactive streams on startup.

This patch should also be backported to 2.4.x.

---
 src/common/consumer-timer.c | 8 ++++++++
 1 file changed, 8 insertions(+)
src/common/consumer-timer.c +8 -0
index c659bf6..c13577f 100644
@@ -118,8 +118,16 @@ static int send_empty_index(struct lttng_consumer_stream *stream, uint64_t ts)
 {
 	int ret;
 	struct ctf_packet_index index;
+	uint64_t stream_id;
+
+	ret = kernctl_get_stream_id(stream->wait_fd, &stream_id);
+	if (ret < 0) {
+		PERROR("kernctl_get_stream_id");
+		goto error;
+	}
 
 	memset(&index, 0, sizeof(index));
+	index.stream_id = htobe64(stream_id);
 	index.timestamp_end = htobe64(ts);
 	ret = consumer_stream_write_index(stream, &index);
 	if (ret < 0) {