X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Fnotification-thread-events.c;h=827cf2c1459f5ee4cb683ac3fd5b0699ab5d9b82;hp=59b10e9db718f82c791abbddd4f8d1e4a8d20ded;hb=f712e5f6c7a77e92abed2f0d0740b9512d1fa4e2;hpb=52d55cf94968516273d6c67f2db428908def55ac diff --git a/src/bin/lttng-sessiond/notification-thread-events.c b/src/bin/lttng-sessiond/notification-thread-events.c index 59b10e9db..827cf2c14 100644 --- a/src/bin/lttng-sessiond/notification-thread-events.c +++ b/src/bin/lttng-sessiond/notification-thread-events.c @@ -1089,6 +1089,7 @@ int notification_thread_client_subscribe(struct notification_client *client, struct notification_client_list *client_list = NULL; struct lttng_condition_list_element *condition_list_element = NULL; struct notification_client_list_element *client_list_element = NULL; + struct lttng_trigger_ht_element *trigger_ht_element; enum lttng_notification_channel_status status = LTTNG_NOTIFICATION_CHANNEL_STATUS_OK; @@ -1138,11 +1139,11 @@ int notification_thread_client_subscribe(struct notification_client *client, * at this point so that conditions that are already TRUE result * in a notification being sent out. * - * The client_list's trigger is used without locking the list itself. - * This is correct since the list doesn't own the trigger and the - * object is immutable. + * Note the iteration on all triggers which share an identical + * `condition` than the one to which the client is registering. This is + * done to ensure that the client receives a distinct notification for + * all triggers that have a `notify` action that have this condition. */ - struct lttng_trigger_ht_element *trigger_ht_element; pthread_mutex_lock(&client_list->lock); cds_list_for_each_entry(trigger_ht_element, &client_list->triggers_list, client_list_trigger_node) { @@ -1151,6 +1152,7 @@ int notification_thread_client_subscribe(struct notification_client *client, WARN("[notification-thread] Evaluation of a condition on client subscription failed, aborting."); ret = -1; free(client_list_element); + pthread_mutex_unlock(&client_list->lock); goto end; } } @@ -4333,7 +4335,7 @@ int notification_client_list_send_evaluation( } } - if (client->uid != lttng_credentials_get_uid(trigger_creds) && client->gid != lttng_credentials_get_gid(trigger_creds)) { + if (client->uid != lttng_credentials_get_uid(trigger_creds)) { DBG("[notification-thread] Skipping client at it does not have the permission to receive notification for this trigger"); goto skip_client; } @@ -4550,7 +4552,6 @@ int dispatch_one_event_notifier_notification(struct notification_thread_state *s element->trigger), struct lttng_condition_on_event, parent), - trigger_name, notification->capture_buffer, notification->capture_buf_size, false);