Merge pull request #22861 from poettering/journald-sigterm

journald: don't let SIGTERM starve indefinitely
This commit is contained in:
Yu Watanabe
2022-03-26 00:27:47 +09:00
committed by GitHub
2 changed files with 80 additions and 3 deletions
+7
View File
@@ -1931,11 +1931,18 @@ static int post_change_thunk(sd_event_source *timer, uint64_t usec, void *userda
}
static void schedule_post_change(JournalFile *f) {
sd_event *e;
int r;
assert(f);
assert(f->post_change_timer);
assert_se(e = sd_event_source_get_event(f->post_change_timer));
/* If we are aleady going down, post the change immediately. */
if (IN_SET(sd_event_get_state(e), SD_EVENT_EXITING, SD_EVENT_FINISHED))
goto fail;
r = sd_event_source_get_enabled(f->post_change_timer, NULL);
if (r < 0) {
log_debug_errno(r, "Failed to get ftruncate timer state: %m");