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;
}
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;
}
rcu_read_unlock();
if (rotation_completed) {
- DBG("[rotation-thread] Totation of trace archive %" PRIu64 " of session \"%s\" is complete on the relay",
+ DBG("[rotation-thread] Rotation of trace archive %" PRIu64 " of session \"%s\" is complete on the relay",
session->current_archive_id - 1,
session->name);
session->rotation_pending_relay = false;
/* 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;
}
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)
{
}
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;
status = lttng_notification_channel_has_pending_notification(
rotate_notification_channel, ¬ification_pending);
if (status != LTTNG_NOTIFICATION_CHANNEL_STATUS_OK) {
- ERR("[rotation-thread ]Error occured while checking for pending notification");
+ ERR("[rotation-thread ]Error occurred while checking for pending notification");
ret = -1;
goto end;
}
ret = handle_notification_channel(fd, handle,
&thread);
if (ret) {
- ERR("[rotation-thread] Error occured while handling activity on notification channel socket");
+ ERR("[rotation-thread] Error occurred while handling activity on notification channel socket");
goto error;
}
}