From: Jérémie Galarneau Date: Wed, 7 Aug 2019 18:27:24 +0000 (-0400) Subject: Fix: don't perform an automatic session rotation in snapshot mode X-Git-Tag: v2.12.0-rc1~518 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=b5893d8e91f64257e58a50c7f5b413a5b31cf076;p=lttng-tools.git Fix: don't perform an automatic session rotation in snapshot mode An automatic session rotation is performed on destruction if more than one trace chunk was created during the lifetime of a session. This is not a good criterion to use in no-output/snapshot mode as multiple trace chunks may have been created during a session's lifetime. The "output_traces" flag is checked explicitly to prevent an automatic session rotation from happenning on destroy. Signed-off-by: Jérémie Galarneau --- diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 10a6de391..f6c44d3be 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3171,7 +3171,11 @@ int cmd_destroy_session(struct ltt_session *session, if (session->most_recent_chunk_id.is_set && session->most_recent_chunk_id.value != 0 && - session->current_trace_chunk) { + session->current_trace_chunk && session->output_traces) { + /* + * Perform a last rotation on destruction if rotations have + * occurred during the session's lifetime. + */ ret = cmd_rotate_session(session, NULL); if (ret != LTTNG_OK) { ERR("Failed to perform an implicit rotation as part of the destruction of session \"%s\": %s",