Fix: src.ctf.lttng-live: session closed before any metadata is received
authorFrancis Deslauriers <francis.deslauriers@efficios.com>
Tue, 23 Nov 2021 15:06:51 +0000 (10:06 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 25 Feb 2022 20:30:38 +0000 (15:30 -0500)
Issue
=====
When stress-testing the LTTng-UST clear feature over an entire night I
witnessed 6 instances of Babeltrace infinite loop.

Using the GNU Debugger, Babeltrace was found to be endlessly issuing the
`LTTNG_VIEWER_GET_NEW_STREAMS` command to the Relay daemon to which the
Relay Daemon endlessly replied `LTTNG_VIEWER_NEW_STREAMS_HUP`.

This is caused by the fact that the session was closed before we
received any metadata and the lttng-live component class keeps trying to
ask for new streams before requesting the metadata.

Fix
===
If the session is marked as closed return a `_STATUS_END` to stop
considering this session.

Signed-off-by: Francis Deslauriers <francis.deslauriers@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I9c18d03cef1b61d1c02b7d608720bf5750a348c4
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7390

src/plugins/ctf/lttng-live/metadata.c

index 582c06626fdda690a6332e1311329e25dc5233a9..e4e6214ad1a8346018a562318ae99026a7b6e712 100644 (file)
@@ -136,7 +136,14 @@ enum lttng_live_iterator_status lttng_live_metadata_update(
 
        /* No metadata stream yet. */
        if (!metadata) {
-               if (session->new_streams_needed) {
+               if (session->closed) {
+                       /*
+                        * The session is closed AND we never received any
+                        * metadata this indicates that we will never receive
+                        * any metadata.
+                        */
+                       status = LTTNG_LIVE_ITERATOR_STATUS_END;
+               } else if (session->new_streams_needed) {
                        status = LTTNG_LIVE_ITERATOR_STATUS_AGAIN;
                } else {
                        session->new_streams_needed = true;
This page took 0.025285 seconds and 4 git commands to generate.