Fix: notification: kernel: consumption of event notification stalls
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index 1093784113cd4e2b35cc5093ab3dd7d5b5bc6b69..1e8618c60062fc8981e2e10b401578474f774f80 100644 (file)
@@ -2039,7 +2039,7 @@ int handle_notification_thread_command_add_tracer_event_source(
                        lttng_domain_type_str(domain_type));
 
        /* Adding the read side pipe to the event poll. */
-       ret = lttng_poll_add(&state->events, tracer_event_source_fd, LPOLLIN | LPOLLERR);
+       ret = lttng_poll_add(&state->events, tracer_event_source_fd, LPOLLPRI | LPOLLIN | LPOLLERR);
        if (ret < 0) {
                ERR("Failed to add tracer event source to poll set: tracer_event_source_fd = %d, domain = '%s'",
                                tracer_event_source_fd,
@@ -2125,7 +2125,7 @@ find_tracer_event_source_element(struct notification_thread_state *state,
 
        source_element = NULL;
 end:
-       return NULL;
+       return source_element;
 }
 
 static
@@ -2153,6 +2153,12 @@ int remove_tracer_event_source_from_pollset(
 
        source_element->is_fd_in_poll_set = false;
 
+       /*
+        * Force the notification thread to restart the poll() loop to ensure
+        * that any events from the removed fd are removed.
+        */
+       state->restart_poll = true;
+
        ret = drain_event_notifier_notification_pipe(state, source_element->fd,
                        source_element->domain);
        if (ret) {
@@ -4421,7 +4427,8 @@ int notification_client_list_send_evaluation(
                         * Notifications resulting from an hidden trigger are
                         * only sent to the session daemon.
                         */
-                       continue;
+                       DBG("Skipping client as the trigger is hidden and the client is not the session daemon");
+                       goto skip_client;
                }
 
                if (source_object_creds) {
This page took 0.024489 seconds and 4 git commands to generate.