Fix: skip closed session on viewer listing
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 7 Sep 2018 19:18:38 +0000 (15:18 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 17 Sep 2018 20:45:30 +0000 (16:45 -0400)
There is  no value in listing  a closed session. A  viewer cannot hook
itself to a closed session in live mode and the session is about to be
removed from the sessions hash table.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-relayd/live.c

index bc0e4529a000a363a377a8de5cbd7cdbf48ddb82..0fd41f1a804f61c2e0582e4bb5b6118bdac831a4 100644 (file)
@@ -835,6 +835,11 @@ int viewer_list_sessions(struct relay_connection *conn)
 
                health_code_update();
 
+               if (session->connection_closed) {
+                       /* Skip closed session */
+                       continue;
+               }
+
                if (count >= buf_count) {
                        struct lttng_viewer_session *newbuf;
                        uint32_t new_buf_count = buf_count << 1;
This page took 0.025959 seconds and 4 git commands to generate.