Fix: sessiond: notification: missing unlock on client list on error
[lttng-tools.git] / src / bin / lttng-sessiond / notification-thread-events.c
index d3b6cd855da47b872ae11e7fa3cbc4446e8de6a3..0836620b59262413c43b8cb97addb8e0f468746b 100644 (file)
@@ -1139,9 +1139,10 @@ 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.
         */
        pthread_mutex_lock(&client_list->lock);
        cds_list_for_each_entry(trigger_ht_element,
@@ -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;
                }
        }
This page took 0.024461 seconds and 4 git commands to generate.