fix: warning '-Wformat-overflow' with GCC 11.2
[lttng-tools.git] / src / bin / lttng-sessiond / rotation-thread.cpp
index 8754d48a1d2eeb519d2273cba67332c01bf50f31..a2b92a858ae612254cafa8d8a13d05558c503bab 100644 (file)
@@ -25,6 +25,7 @@
 #include <lttng/notification/channel-internal.h>
 #include <lttng/rotate-internal.h>
 #include <lttng/location-internal.h>
+#include <lttng/condition/condition-internal.h>
 
 #include "rotation-thread.h"
 #include "lttng-sessiond.h"
@@ -584,7 +585,7 @@ int handle_job_queue(struct rotation_thread_handle *handle,
                session = job->session;
                if (!session) {
                        DBG("Session \"%s\" not found",
-                                       session->name);
+                                       session->name != NULL ? session->name : "");
                        /*
                         * This is a non-fatal error, and we cannot report it to
                         * the user (timer), so just print the error and
@@ -659,10 +660,15 @@ int handle_condition(const struct lttng_condition *condition,
        session_lock_list();
        session = session_find_by_name(condition_session_name);
        if (!session) {
-               ret = -1;
-               session_unlock_list();
-               ERR("Session \"%s\" not found",
+               DBG("Failed to find session while handling notification: notification type = %s, session name = `%s`",
+                               lttng_condition_type_str(condition_type),
                                condition_session_name);
+               /*
+                * Not a fatal error: a session can be destroyed before we get
+                * the chance to handle the notification.
+                */
+               ret = 0;
+               session_unlock_list();
                goto end;
        }
        session_lock(session);
This page took 0.023583 seconds and 4 git commands to generate.