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)
committerJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Fri, 21 Sep 2018 04:23:59 +0000 (00:23 -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 d0b8abdae177c820311219dae389258c8b8279b3..3921f251feadaee95d48a1dee7960e5cbe270980 100644 (file)
@@ -916,6 +916,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.027595 seconds and 5 git commands to generate.