]> git.ipfire.org Git - thirdparty/systemd.git/commit
Periodically call sd_journal_process in journalctl
authorPeter Portante <peter.a.portante@gmail.com>
Sun, 28 Jan 2018 21:48:04 +0000 (16:48 -0500)
committerLennart Poettering <lennart@poettering.net>
Thu, 8 Feb 2018 19:04:18 +0000 (20:04 +0100)
commit992149c07e3ecfbfe4067641e92a6923e7aacda4
tree102d75e9e1295115b5750ba181ca7487292a1476
parentbf443be99565e4327f1c8c12b79d98b4c1529cf1
Periodically call sd_journal_process in journalctl

If `journalctl` take a long time to process messages, and during that
time journal file rotation occurs, a `journalctl` client will keep
those rotated files open until it calls `sd_journal_process()`, which
typically happens as a result of calling `sd_journal_wait()` below in
the "following" case.  By periodically calling `sd_journal_process()`
during the processing loop we shrink the window of time a client
instance has open file descriptors for rotated (deleted) journal
files.

**Warning**

This change does not appear to solve the case of a "paused" output
stream. If somebody is using `journalctl | less` and pauses the
output, then without a background thread periodically listening for
inotify delete events and cleaning up, journal logs will eventually
stop flowing in cases where a journal client with enough open files
causes the "free" disk space threshold to be crossed.
src/journal/journalctl.c