* 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.
*/
pthread_mutex_lock(&client_list->lock);
cds_list_for_each_entry(trigger_ht_element,
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;
}
}
}
}
- 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;
}
struct notification_trigger_tokens_ht_element,
node);
- if (!lttng_trigger_should_fire(element->trigger)) {
- ret = 0;
- goto end_unlock;
- }
-
- lttng_trigger_fire(element->trigger);
-
trigger_status = lttng_trigger_get_name(element->trigger, &trigger_name);
assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
goto put_list;
}
- if (!lttng_trigger_should_fire(trigger)) {
- goto put_list;
- }
-
- lttng_trigger_fire(trigger);
-
/*
* Ownership of `evaluation` transferred to the action executor
* no matter the result.