journalctl: 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>
Mon, 12 Feb 2018 10:27:12 +0000 (11:27 +0100)
commitec316d199a13d8db3f6550d60e369893de2fb417
tree4adda9c319fd9ceaa79d7aebc24ca7ece5f6ced3
parent10c4d6405f74258ea4fac5db4888c1bf49ad5399
journalctl: 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.

(Lennart: slightly reworked version, that dropped some of the commenting
which was solved otherwise)
src/journal/journalctl.c