From b3feb91b1a4acba45c9d446688cdc828d57d0b66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 14 Nov 2019 17:12:08 -0500 Subject: [PATCH] Fix: relayd: viewer session trace chunk not released on detach MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The 'attach' command on a viewer session expects (asserts) the trace chunk of the viewer session to be NULL. This is reasonable as there is no reason to hold a reference to a trace chunk while no clients are attached. Release the reference to the trace chunk on detach. The relay session's trace chunk will be re-sampled (copied) when the next client attaches to the viewer session. Signed-off-by: Jérémie Galarneau --- src/bin/lttng-relayd/viewer-session.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/lttng-relayd/viewer-session.c b/src/bin/lttng-relayd/viewer-session.c index 7a5bd6dca..20f3d0e43 100644 --- a/src/bin/lttng-relayd/viewer-session.c +++ b/src/bin/lttng-relayd/viewer-session.c @@ -178,7 +178,8 @@ void viewer_session_close_one_session(struct relay_viewer_session *vsession, */ viewer_stream_put(vstream); } - + lttng_trace_chunk_put(vsession->current_trace_chunk); + vsession->current_trace_chunk = NULL; viewer_session_detach(vsession, session); } -- 2.34.1