Fix: rotation: hang on destroy when using scheduled rotation based on timer
[lttng-tools.git] / src / bin / lttng-sessiond / cmd.cpp
index e16f93f71881c2db7ab6de10c4f57639eaa4dd69..0e9821eb693f327fa7b69c74f104df1b0398bfea 100644 (file)
@@ -2818,7 +2818,7 @@ int cmd_start_trace(struct ltt_session *session)
         */
        session->rotated_after_last_stop = false;
 
-       if (session->rotate_timer_period) {
+       if (session->rotate_timer_period && !session->rotation_schedule_timer_enabled) {
                int int_ret = timer_session_rotation_schedule_timer_start(
                                session, session->rotate_timer_period);
 
@@ -3785,14 +3785,15 @@ enum lttng_error_code cmd_list_channels(enum lttng_domain_type domain,
 
                        ret = lttng_channel_serialize(
                                        channel, &payload->buffer);
-                       lttng_channel_destroy(channel);
                        if (ret) {
                                ERR("Failed to serialize lttng_channel: channel name = '%s'",
                                                channel->name);
+                               lttng_channel_destroy(channel);
                                ret_code = LTTNG_ERR_UNK;
                                goto end;
                        }
 
+                       lttng_channel_destroy(channel);
                        i++;
                }
                rcu_read_unlock();
This page took 0.023282 seconds and 4 git commands to generate.