X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Faction-executor.c;h=fc7d03d70a9fa4a3701ec5cce53ff98422df0a76;hp=c51bb7f639cd7143d3301fbac8c2b385715ece11;hb=17182cfd13b6d35cf8c80d4f9ccf8d2bdd1a05f2;hpb=f2b3ef9f7d7adf6cc0678cd5933b638f5a9e75a6 diff --git a/src/bin/lttng-sessiond/action-executor.c b/src/bin/lttng-sessiond/action-executor.c index c51bb7f63..fc7d03d70 100644 --- a/src/bin/lttng-sessiond/action-executor.c +++ b/src/bin/lttng-sessiond/action-executor.c @@ -104,7 +104,7 @@ static const char *action_type_names[] = { static const char *get_action_name(const struct lttng_action *action) { - return action_type_names[lttng_action_get_type_const(action)]; + return action_type_names[lttng_action_get_type(action)]; } /* Check if this trigger allowed to interect with a given session. */ @@ -143,8 +143,6 @@ static int client_handle_transmission_status( struct action_executor *executor = user_data; bool update_communication = true; - ASSERT_LOCKED(client->lock); - switch (status) { case CLIENT_TRANSMISSION_STATUS_COMPLETE: DBG("Successfully sent full notification to client, client_id = %" PRIu64, @@ -158,12 +156,10 @@ static int client_handle_transmission_status( case CLIENT_TRANSMISSION_STATUS_FAIL: DBG("Communication error occurred while sending notification to client, client_id = %" PRIu64, client->id); - client->communication.active = false; break; default: ERR("Fatal error encoutered while sending notification to client, client_id = %" PRIu64, client->id); - client->communication.active = false; ret = -1; goto end; } @@ -172,6 +168,7 @@ static int client_handle_transmission_status( goto end; } + /* Safe to read client's id without locking as it is immutable. */ ret = notification_thread_client_communication_update( executor->notification_thread_handle, client->id, status); @@ -489,7 +486,7 @@ static int action_executor_generic_handler(struct action_executor *executor, work_item->trigger, work_item->id); - return action_executors[lttng_action_get_type_const(action)]( + return action_executors[lttng_action_get_type(action)]( executor, work_item, action); } @@ -566,7 +563,9 @@ static void *action_executor_thread(void *_data) pthread_mutex_lock(&executor->work.lock); } - pthread_mutex_unlock(&executor->work.lock); + if (executor->should_quit) { + pthread_mutex_unlock(&executor->work.lock); + } DBG("Left work execution loop"); health_code_update();