HomeClusterLabs Projects

Fix: cts-lab: Parse log watch timestamps on exerciser side

Description

Fix: cts-lab: Parse log watch timestamps on exerciser side

At least as of systemd v254, journalctl has the following bug: if
--after-cursor, --until, and --lines options are all three used, the
--until option is ignored.

This results in an infinite loop in LogWatcher.look(). When we reach the
timeout, we call set_end() on the JournalObj to set a limit timestamp,
so that we can get all remaining logs that were created until the
timeout expired. Then we run the following repeatedly until we reach the
limit (as determined by the output containing only a cursor):

journalctl --after-cursor=X --until=self.limit --lines=200

Due to the bug, the command above will continue to yield log messages
indefinitely. As long as we keep finding log messages and adding them to
our line cache, we'll keep looping.

This commit works around the issue by moving the limit timestamp
handling from journalctl's "--until" option into the
JournalObj.async_complete() method. It's not as clean as letting
journalctl handle it, but that's not an option anymore.

Systemd bug report:

Signed-off-by: Reid Wahl <nrwahl@protonmail.com>

Details

Provenance
nrwahl2Authored on Mar 14 2024, 5:45 PM
Parents
rPd7519128eed8: Refactor: cts-lab: Move {File,Journal}Obj._delegate to SearchObj
Branches
Unknown
Tags
Unknown