There is no synchronization point guaranteeing the presence of metadata on
lttng-relayd side when the live metadata request is done. It must be
present at some point in the future but might not be at the moment we
perform the request.
Add a retry phase to this step. It must succeed in the future.
Not sure how this test was never marked as flaky.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I033005c6a228013e699c74d8e8faafcb3272dd98
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
rq.stream_id = htobe64(session->streams[metadata_stream_id].id);
+retry:
ret_len = lttng_live_send(control_sock, &cmd, sizeof(cmd));
if (ret_len < 0) {
diag("Error sending cmd");
break;
case LTTNG_VIEWER_NO_NEW_METADATA:
diag("Got LTTNG_VIEWER_NO_NEW_METADATA:");
- ret = 0;
- goto end;
+ usleep(50);
+ goto retry;
case LTTNG_VIEWER_METADATA_ERR:
diag("Got LTTNG_VIEWER_METADATA_ERR:");
goto error;
}
free(data);
ret = len;
-end:
+
return ret;
error_free_data: