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:48 +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 7c812fe9348dc0f093fb77930256f54669125fbf..a94afa0b046f032313f7662f96ef2f2e4e9fb42c 100644 (file)
@@ -834,6 +834,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.026829 seconds and 4 git commands to generate.