Fix: lttng: Destroying session message repeated during destruction
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 14 May 2020 20:08:56 +0000 (16:08 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 20 May 2020 22:38:35 +0000 (18:38 -0400)
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 <jeremie.galarneau@efficios.com>
Change-Id: I6cd29d917925644a4994c515b4177bbd05ffa98e

src/bin/lttng/commands/destroy.c

index eed1fe5c5878fc15679009c64b18e0788adf0cf9..2e473f519f3c52924eb7f3c40ac30b8ff8870ab0 100644 (file)
@@ -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(".");
This page took 0.025961 seconds and 4 git commands to generate.