if (req->offline)
manager_full_sync(req->manager, /* wait = */ true);
+ log_debug("Client request to sync journal (%s offlining) completed.", req->offline ? "with" : "without");
+
/* Disconnect the SyncReq from the Varlink connection object, and free it */
_cleanup_(sd_varlink_unrefp) sd_varlink *vl = TAKE_PTR(req->link);
sd_varlink_set_userdata(vl, req->manager); /* reinstall manager object */
log_info("Received client request to rotate journal, rotating.");
manager_full_rotate(m);
+ log_debug("Client request to rotate journal completed.");
return sd_varlink_reply(link, NULL);
}
log_info("Received client request to flush runtime journal.");
manager_full_flush(m);
+ log_debug("Client request to flush runtime journal completed.");
return sd_varlink_reply(link, NULL);
}
log_info("Received client request to relinquish %s access.", m->system_storage.path);
manager_relinquish_var(m);
+ log_debug("Client request to relinquish %s access completed.", m->system_storage.path);
return sd_varlink_reply(link, NULL);
}
if (f->offline_state == OFFLINE_JOINED)
return 0;
+ log_debug("Joining journal offlining thread for %s.", f->path);
+
r = pthread_join(f->offline_thread, NULL);
if (r)
return -r;
+ log_debug("Journal offlining thread for %s joined.", f->path);
+
f->offline_state = OFFLINE_JOINED;
if (mmap_cache_fd_got_sigbus(f->cache_fd))
#include "fd-util.h"
#include "journal-authenticate.h"
#include "journal-file-util.h"
+#include "journal-internal.h"
#include "log.h"
+#include "log-ratelimit.h"
#include "set.h"
#include "string-util.h"
target_state = f->archive ? STATE_ARCHIVED : STATE_OFFLINE;
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Journal file %s is %s transitioning to %s.",
+ f->path,
+ wait ? "synchronously" : "asynchronously",
+ f->archive ? "archived" : "offline");
+
/* An offlining journal is implicitly online and may modify f->header->state,
* we must also join any potentially lingering offline thread when already in
* the desired offline state.
*/
- if (!journal_file_is_offlining(f) && f->header->state == target_state)
+ if (!journal_file_is_offlining(f) && f->header->state == target_state) {
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Journal file %s is already %s, waiting for offlining thread.",
+ f->path,
+ f->archive ? "archived" : "offline");
return journal_file_set_offline_thread_join(f);
+ }
/* Restart an in-flight offline thread and wait if needed, or join a lingering done one. */
restarted = journal_file_set_offline_try_restart(f);
if (restarted)
return 0;
+ log_ratelimit_full(LOG_DEBUG,
+ JOURNAL_LOG_RATELIMIT,
+ "Starting new %s offlining operation for journal file %s.",
+ wait ? "synchronous" : "asynchronous",
+ f->path);
+
/* Initiate a new offline. */
f->offline_state = OFFLINE_SYNCING;