Fix: incorrect time unit used when waiting on destruction handle
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 7 Aug 2019 18:21:11 +0000 (14:21 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 5 Sep 2019 20:39:14 +0000 (16:39 -0400)
DEFAULT_DATA_AVAILABILITY_WAIT_TIME is used by the lttng client to
wait on the destruction handle returned by a session destruction
command. This constant is in micro-seconds while the destruction
handle expects a timeout in ms.

This causes the client to appear unresponsive while waiting for
the destruction of a session.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng/commands/destroy.c
src/bin/lttng/commands/rotate.c
src/bin/lttng/commands/stop.c
src/common/defaults.h
src/lib/lttng-ctl/lttng-ctl.c

index e52735f439a453067f6099c59ba7a594891a72b4..a258f64097f275c0c116c4cae1232f5dba181544 100644 (file)
@@ -101,7 +101,7 @@ static int destroy_session(struct lttng_session *session)
                                        fflush(stdout);
                                }
 
-                               usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME);
+                               usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US);
                                _MSG(".");
                                fflush(stdout);
                        }
@@ -127,7 +127,7 @@ static int destroy_session(struct lttng_session *session)
 
        do {
                status = lttng_destruction_handle_wait_for_completion(handle,
-                               DEFAULT_DATA_AVAILABILITY_WAIT_TIME);
+                               DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US / USEC_PER_MSEC);
                switch (status) {
                case LTTNG_DESTRUCTION_HANDLE_STATUS_TIMEOUT:
                        if (!printed_wait_msg) {
index ab31546f9372e29bd63077077635bc30995f11a4..e1ed0eb7c56d983ca377b82451c8d397c07aa86e 100644 (file)
@@ -104,7 +104,7 @@ static int rotate_tracing(char *session_name)
                }
 
                if (rotation_state == LTTNG_ROTATION_STATE_ONGOING) {
-                       ret = usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME);
+                       ret = usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US);
                        if (ret) {
                                PERROR("\nusleep");
                                goto error;
index 9d211d68b58d4ee37b44244aa3a56012f1f94c9f..d2040b9f99bb8314eb60547fe312060b08a0c01d 100644 (file)
@@ -135,7 +135,7 @@ static int stop_tracing(void)
                         * returned value indicates availability.
                         */
                        if (ret) {
-                               usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME);
+                               usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US);
                                _MSG(".");
                                fflush(stdout);
                        }
index 08bbb64b91a30a58ff3ef2c3adab4998205fb7c4..183e315183356c1ebca2f5a8d4f65beea7dbc1b2 100644 (file)
  * Wait period before retrying the lttng_data_pending command in the lttng
  * stop command of liblttng-ctl.
  */
-#define DEFAULT_DATA_AVAILABILITY_WAIT_TIME 200000  /* usec */
+#define DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US 200000  /* usec */
 
 /*
  * Wait period before retrying the lttng_consumer_flushed_cache when
index 8c52c456dd15bf63a0cee9797515d373246e5b24..d9e961f2cf1deb243a60a6133a8264acedbb7d28 100644 (file)
@@ -724,7 +724,7 @@ static int _lttng_stop_tracing(const char *session_name, int wait)
                 * call returned value indicates availability.
                 */
                if (data_ret) {
-                       usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME);
+                       usleep(DEFAULT_DATA_AVAILABILITY_WAIT_TIME_US);
                }
        } while (data_ret != 0);
 
This page took 0.028866 seconds and 4 git commands to generate.