X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.c;h=1a71131f0f90d398c37468db093372a3449120e8;hp=049a6d3fcc150d8c5afe9239860244c87997adb3;hb=ac16173e318279dee29504820e3c2ad8ea597712;hpb=173900f678f7f969c79a88ceac2f1e4be2588f79 diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 049a6d3fc..1a71131f0 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -1921,7 +1921,6 @@ int handle_notification_thread_command_add_tracer_event_source( goto end; } - CDS_INIT_LIST_HEAD(&element->node); element->fd = tracer_event_source_fd; element->domain = domain_type; @@ -1956,6 +1955,7 @@ int handle_notification_thread_command_remove_tracer_event_source( enum lttng_error_code *_cmd_result) { int ret = 0; + bool found = false; enum lttng_error_code cmd_result = LTTNG_OK; struct notification_event_tracer_event_source_element *source_element = NULL, *tmp; @@ -1969,11 +1969,19 @@ int handle_notification_thread_command_remove_tracer_event_source( tracer_event_source_fd, lttng_domain_type_str(source_element->domain)); cds_list_del(&source_element->node); + found = true; break; } - /* It should always be found. */ - assert(source_element); + if (!found) { + /* + * This is temporarily allowed since the poll activity set is + * not properly cleaned-up for the moment. This is adressed in + * an upcoming fix. + */ + source_element = NULL; + goto end; + } if (!source_element->is_fd_in_poll_set) { /* Skip the poll set removal. */ @@ -2662,7 +2670,7 @@ void free_notification_trigger_tokens_ht_element_rcu(struct rcu_head *node) static int handle_notification_thread_command_unregister_trigger( struct notification_thread_state *state, - struct lttng_trigger *trigger, + const struct lttng_trigger *trigger, enum lttng_error_code *_cmd_reply) { struct cds_lfht_iter iter; @@ -2670,7 +2678,7 @@ int handle_notification_thread_command_unregister_trigger( struct lttng_channel_trigger_list *trigger_list; struct notification_client_list *client_list; struct lttng_trigger_ht_element *trigger_ht_element = NULL; - struct lttng_condition *condition = lttng_trigger_get_condition( + const struct lttng_condition *condition = lttng_trigger_get_const_condition( trigger); enum lttng_error_code cmd_reply; @@ -2784,14 +2792,15 @@ int handle_notification_thread_command( switch (cmd->type) { case NOTIFICATION_COMMAND_TYPE_REGISTER_TRIGGER: DBG("[notification-thread] Received register trigger command"); - ret = handle_notification_thread_command_register_trigger( - state, cmd->parameters.trigger, + ret = handle_notification_thread_command_register_trigger(state, + cmd->parameters.register_trigger.trigger, &cmd->reply_code); break; case NOTIFICATION_COMMAND_TYPE_UNREGISTER_TRIGGER: DBG("[notification-thread] Received unregister trigger command"); ret = handle_notification_thread_command_unregister_trigger( - state, cmd->parameters.trigger, + state, + cmd->parameters.unregister_trigger.trigger, &cmd->reply_code); break; case NOTIFICATION_COMMAND_TYPE_ADD_CHANNEL: