X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.c;h=212746faa1c7a50d67e3006f868908222a00d22c;hb=2fb5e9b7971e2408dce182fcf7e87cd81dcb388b;hp=81fba4e6912253c7daf8b825594bf3106cc93361;hpb=e7c93cf951a3a2316cb66ca240127d3d23280e29;p=lttng-tools.git diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 81fba4e69..212746faa 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. */ @@ -1994,6 +2002,8 @@ int handle_notification_thread_command_remove_tracer_event_source( goto end; } + source_element->is_fd_in_poll_set = false; + end: free(source_element); *_cmd_result = cmd_result;