From 407d6c7b0f04745ec5455e2a031165cf1be9e091 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 2 Apr 2020 00:25:11 -0400 Subject: [PATCH] Fix: sessiond: error reported on session destruction for old modules MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The session destruction command will return -LTTNG_ERR_ROTATION_NOT_AVAILABLE_KERNEL when the kernel tracer version does not support packet sequence numbers which prevents rotations from being performed. It is okay to not perform an implicit rotation in this case since we know that no rotations have occurred during the session's lifetime (as it is not supported). Thus, the client/library only needs to stop the session, wait for pending data, and destroy the session. Signed-off-by: Jérémie Galarneau Change-Id: Ibccf73f08eecb6431ea3cc358bf8dd6af3ba4427 --- src/bin/lttng-sessiond/cmd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c index 2bd010f89..e45d4423a 100644 --- a/src/bin/lttng-sessiond/cmd.c +++ b/src/bin/lttng-sessiond/cmd.c @@ -3402,9 +3402,17 @@ int cmd_destroy_session(struct ltt_session *session, */ ret = cmd_rotate_session(session, NULL, true, LTTNG_TRACE_CHUNK_COMMAND_TYPE_NO_OPERATION); - if (ret != LTTNG_OK) { + /* + * Rotation operations may not be supported by the kernel + * tracer. Hence, do not consider this implicit rotation as + * a session destruction error. The library has already stopped + * the session and waited for pending data; there is nothing + * left to do but complete the destruction of the session. + */ + if (ret != LTTNG_OK && + ret != -LTTNG_ERR_ROTATION_NOT_AVAILABLE_KERNEL) { ERR("Failed to perform a quiet rotation as part of the destruction of session \"%s\": %s", - session->name, lttng_strerror(-ret)); + session->name, lttng_strerror(ret)); destruction_last_error = -ret; } } -- 2.34.1