From: Jonathan Rajotte Date: Fri, 7 Sep 2018 19:18:38 +0000 (-0400) Subject: Fix: skip closed session on viewer listing X-Git-Tag: v2.9.11~17 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=baa8150c013cda7f44bb7d82b44242f4030b472b;p=lttng-tools.git Fix: skip closed session on viewer listing 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 Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-relayd/live.c b/src/bin/lttng-relayd/live.c index 7c812fe93..a94afa0b0 100644 --- a/src/bin/lttng-relayd/live.c +++ b/src/bin/lttng-relayd/live.c @@ -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;