X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fbin%2Flttng-sessiond%2Frotation-thread.c;h=68a5d402f9ae3a8f80d97f142851ef95288b8046;hp=3256a1e9b6581899380cb47f16cb35b10a90b32c;hb=2961f09e9ea0e7a23dade01014caa40fb323d6bd;hpb=ed1e52a3cc41925b701cd1343ace4c450ff836d9 diff --git a/src/bin/lttng-sessiond/rotation-thread.c b/src/bin/lttng-sessiond/rotation-thread.c index 3256a1e9b..68a5d402f 100644 --- a/src/bin/lttng-sessiond/rotation-thread.c +++ b/src/bin/lttng-sessiond/rotation-thread.c @@ -431,7 +431,12 @@ end: session->rotation_pending_local = false; } if (ret) { - session->rotation_state = LTTNG_ROTATION_STATE_ERROR; + ret = session_reset_rotation_state(session, + LTTNG_ROTATION_STATE_ERROR); + if (ret) { + ERR("Failed to reset rotation state of session \"%s\"", + session->name); + } } return 0; } @@ -491,7 +496,12 @@ int check_session_rotation_pending_relay(struct ltt_session *session) ERR("[rotation-thread] Encountered an error when checking if rotation of trace archive %" PRIu64 " of session \"%s\" is pending on the relay", session->current_archive_id - 1, session->name); - session->rotation_state = LTTNG_ROTATION_STATE_ERROR; + ret = session_reset_rotation_state(session, + LTTNG_ROTATION_STATE_ERROR); + if (ret) { + ERR("Failed to reset rotation state of session \"%s\"", + session->name); + } rotation_completed = false; } @@ -555,7 +565,12 @@ int check_session_rotation_pending(struct ltt_session *session, /* Rename the completed trace archive's location. */ now = time(NULL); if (now == (time_t) -1) { - session->rotation_state = LTTNG_ROTATION_STATE_ERROR; + ret = session_reset_rotation_state(session, + LTTNG_ROTATION_STATE_ERROR); + if (ret) { + ERR("Failed to reset rotation state of session \"%s\"", + session->name); + } ret = LTTNG_ERR_UNK; goto end; }