Fix: sessiond: assert on empty payload when handling client out event
[lttng-tools.git] / src / bin / lttng-sessiond / action-executor.c
index 878680a70ff557c0fa7a64702e0cbd02da2ccbee..51f380423189985e6a9aea9a2a3f383adc82c1b8 100644 (file)
@@ -233,6 +233,15 @@ static int client_handle_transmission_status(
        case CLIENT_TRANSMISSION_STATUS_COMPLETE:
                DBG("Successfully sent full notification to client, client_id = %" PRIu64,
                                client->id);
+               /*
+                * There is no need to wake the (e)poll thread. If it was waiting for
+                * "out" events on the client's socket, it will see that no payload
+                * in queued and will unsubscribe from that event.
+                *
+                * In the other cases, we have to wake the the (e)poll thread to either
+                * handle the error on the client or to get it to monitor the client "out"
+                * events.
+                */
                update_communication = false;
                break;
        case CLIENT_TRANSMISSION_STATUS_QUEUED:
@@ -301,7 +310,7 @@ static int action_executor_start_session_handler(
         * existed. If not skip the action altogether.
         */
        if (!item->context.session_id.is_set) {
-               DBG("Session `%s` was not present at the moment the work item was enqueued for %s` action of trigger `%s`",
+               DBG("Session `%s` was not present at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, get_action_name(action),
                                get_trigger_name(work_item->trigger));
                lttng_action_increase_execution_failure_count(action);
@@ -325,7 +334,7 @@ static int action_executor_start_session_handler(
        if (session->id != LTTNG_OPTIONAL_GET(item->context.session_id)) {
                DBG("Session id for session `%s` (id: %" PRIu64
                                " is not the same that was sampled (id: %" PRIu64
-                               " at the moment the work item was enqueued for %s` action of trigger `%s`",
+                               " at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, session->id,
                                LTTNG_OPTIONAL_GET(item->context.session_id),
                                get_action_name(action),
@@ -393,7 +402,7 @@ static int action_executor_stop_session_handler(
         * existed. If not, skip the action altogether.
         */
        if (!item->context.session_id.is_set) {
-               DBG("Session `%s` was not present at the moment the work item was enqueued for %s` action of trigger `%s`",
+               DBG("Session `%s` was not present at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, get_action_name(action),
                                get_trigger_name(work_item->trigger));
                lttng_action_increase_execution_failure_count(action);
@@ -418,7 +427,7 @@ static int action_executor_stop_session_handler(
        if (session->id != LTTNG_OPTIONAL_GET(item->context.session_id)) {
                DBG("Session id for session `%s` (id: %" PRIu64
                                " is not the same that was sampled (id: %" PRIu64
-                               " at the moment the work item was enqueued for %s` action of trigger `%s`",
+                               " at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, session->id,
                                LTTNG_OPTIONAL_GET(item->context.session_id),
                                get_action_name(action),
@@ -486,7 +495,7 @@ static int action_executor_rotate_session_handler(
         * existed. If not, skip the action altogether.
         */
        if (!item->context.session_id.is_set) {
-               DBG("Session `%s` was not present at the moment the work item was enqueued for %s` action of trigger `%s`",
+               DBG("Session `%s` was not present at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, get_action_name(action),
                                get_trigger_name(work_item->trigger));
                lttng_action_increase_execution_failure_count(action);
@@ -511,7 +520,7 @@ static int action_executor_rotate_session_handler(
        if (session->id != LTTNG_OPTIONAL_GET(item->context.session_id)) {
                DBG("Session id for session `%s` (id: %" PRIu64
                    " is not the same that was sampled (id: %" PRIu64
-                   " at the moment the work item was enqueued for %s` action of trigger `%s`",
+                   " at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, session->id,
                                LTTNG_OPTIONAL_GET(item->context.session_id),
                                get_action_name(action),
@@ -582,7 +591,7 @@ static int action_executor_snapshot_session_handler(
         * existed. If not, skip the action altogether.
         */
        if (!item->context.session_id.is_set) {
-               DBG("Session was not present at the moment the work item was enqueued for %s` action of trigger `%s`",
+               DBG("Session was not present at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                get_action_name(action),
                                get_trigger_name(work_item->trigger));
                lttng_action_increase_execution_failure_count(action);
@@ -626,7 +635,7 @@ static int action_executor_snapshot_session_handler(
        if (session->id != LTTNG_OPTIONAL_GET(item->context.session_id)) {
                DBG("Session id for session `%s` (id: %" PRIu64
                    " is not the same that was sampled (id: %" PRIu64
-                   " at the moment the work item was enqueued for %s` action of trigger `%s`",
+                   " at the moment the work item was enqueued for `%s` action of trigger `%s`",
                                session_name, session->id,
                                LTTNG_OPTIONAL_GET(item->context.session_id),
                                get_action_name(action),
@@ -791,7 +800,7 @@ static void *action_executor_thread(void *_data)
                                        work_item->trigger, &trigger_owner_uid);
                        assert(trigger_status == LTTNG_TRIGGER_STATUS_OK);
 
-                       DBG("Work item skipped since the associated trigger is no longer registered: work item id = %" PRIu64 ", trigger name = '%s', trigger owner uid = %d",
+                       DBG("Work item skipped since the associated trigger is no longer registered: work item id = %" PRIu64 ", trigger name = `%s`, trigger owner uid = %d",
                                        work_item->id, trigger_name,
                                        (int) trigger_owner_uid);
                        ret = 0;
@@ -924,7 +933,7 @@ enum action_executor_status action_executor_enqueue_trigger(
 
        work_item = zmalloc(sizeof(*work_item));
        if (!work_item) {
-               PERROR("Failed to allocate action executor work item: trigger name = '%s'",
+               PERROR("Failed to allocate action executor work item: trigger name = `%s`",
                                get_trigger_name(trigger));
                executor_status = ACTION_EXECUTOR_STATUS_ERROR;
                goto error_unlock;
This page took 0.039693 seconds and 4 git commands to generate.