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:50:28 +0000 (16:50 -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 f32a0a59707c4beb72ba9bd17b2680bfa89ed4c5..f81872b9d1b4cfffa138dcb99eb40cc8b863db77 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.027114 seconds and 5 git commands to generate.