Fix: consumerd channel destroy race
[lttng-tools.git] / src / common / ust-consumer / ust-consumer.c
index 8c15c7e135016098f3cb90a94923ec9eb3fc9d93..7d9444cd00b84300450e69676b6d42a668032e67 100644 (file)
@@ -998,17 +998,13 @@ int lttng_ustconsumer_recv_cmd(struct lttng_consumer_local_data *ctx,
        case LTTNG_CONSUMER_DESTROY_CHANNEL:
        {
                uint64_t key = msg.u.destroy_channel.key;
-               struct lttng_consumer_channel *channel;
-
-               channel = consumer_find_channel(key);
-               if (!channel) {
-                       ERR("UST consumer get channel key %" PRIu64 " not found", key);
-                       ret_code = LTTNG_ERR_UST_CHAN_NOT_FOUND;
-                       goto end_msg_sessiond;
-               }
-
-               destroy_channel(channel);
 
+               /*
+                * Only called if streams have not been sent to stream
+                * manager thread. However, channel has been sent to
+                * channel manager thread.
+                */
+               notify_thread_del_channel(ctx, key);
                goto end_msg_sessiond;
        }
        case LTTNG_CONSUMER_CLOSE_METADATA:
This page took 0.023069 seconds and 4 git commands to generate.