Fix: session_list lock must be held to launch a rotation
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 14 Nov 2018 21:00:15 +0000 (16:00 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 16 Nov 2018 18:49:51 +0000 (13:49 -0500)
The timer.h functions are documented as needing the session_list
lock to be held. Since timers are setup during the launch of a
rotation, the session_list lock must be taken while a job is
executed by the rotation thread.

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/bin/lttng-sessiond/rotation-thread.c

index 25dbf76a932c3414f294848f2211a42e5e8659e3..3256a1e9b6581899380cb47f16cb35b10a90b32c 100644 (file)
@@ -642,7 +642,7 @@ end:
        return ret;
 }
 
-/* Call with the session lock held. */
+/* Call with the session and session_list locks held. */
 static
 int launch_session_rotation(struct ltt_session *session)
 {
@@ -736,10 +736,9 @@ int handle_job_queue(struct rotation_thread_handle *handle,
                }
 
                session_lock(session);
-               session_unlock_list();
-
                ret = run_job(job, session, handle->notification_thread_handle);
                session_unlock(session);
+               session_unlock_list();
                free(job);
                if (ret) {
                        goto end;
This page took 0.039039 seconds and 5 git commands to generate.