Fix: sessiond: triggers: failure to insert trigger is fatal
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 21 Apr 2021 04:41:09 +0000 (00:41 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Thu, 22 Apr 2021 05:57:24 +0000 (01:57 -0400)
Inserting a trigger by name/owner should succeed if it could be added
to the top-level triggers_ht.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I46518b86b34cb13074723b4f2bef38026d898700

src/bin/lttng-sessiond/notification-thread-events.c

index f13e22a17ab66ea73492a2e4d5aaddf73a3cbe4e..c9c21bc7225df72ee21ad8a74d33f101dd878aca 100644 (file)
@@ -2729,9 +2729,8 @@ int handle_notification_thread_command_register_trigger(
                        trigger,
                        &trigger_ht_element->node_by_name_uid);
        if (node != &trigger_ht_element->node_by_name_uid) {
-               /* Not a fatal error, simply report it to the client. */
-               cds_lfht_del(state->triggers_ht, &trigger_ht_element->node);
-               *cmd_result = LTTNG_ERR_TRIGGER_EXISTS;
+               /* Internal error: add to triggers_ht should have failed. */
+               ret = -1;
                goto error_free_ht_element;
        }
 
This page took 0.029645 seconds and 4 git commands to generate.