From dec2c8e12255d3533664cba9042f0d051c4207ac Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 14 May 2020 16:08:56 -0400 Subject: [PATCH] Fix: lttng: Destroying session message repeated during destruction MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Observed Issue ============== The `Destroying session X` is repeated indifinitely whenever the data pending phase lasts more than one iteration. ``` $ lttng destroy Destroying session eloi_turcotte.Destroying session eloi_turcotte.Destroying session eloi_turcotte.Destroying session eloi_turcotte.D ``` Cause ===== Missing check that the message has been printed. Solution ======== Use the same check as is done later for lttng_destruction_handle_wait_for_completion(). Known drawbacks =============== None. Signed-off-by: Jérémie Galarneau Change-Id: I6cd29d917925644a4994c515b4177bbd05ffa98e --- src/bin/lttng/commands/destroy.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/bin/lttng/commands/destroy.c b/src/bin/lttng/commands/destroy.c index eed1fe5c5..2e473f519 100644 --- a/src/bin/lttng/commands/destroy.c +++ b/src/bin/lttng/commands/destroy.c @@ -87,10 +87,13 @@ static int destroy_session(struct lttng_session *session) * availability. */ if (ret) { - _MSG("Destroying session %s", session->name); - newline_needed = true; - printed_destroy_msg = true; - fflush(stdout); + if (!printed_destroy_msg) { + _MSG("Destroying session %s", + session->name); + newline_needed = true; + printed_destroy_msg = true; + fflush(stdout); + } usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US); _MSG("."); -- 2.34.1