Files
systemd/src/journal-remote
Jan Čermák db8b91980b journal-gatewayd: fix busy loop when following way beyond journal end
Fix regression introduced in a7bfb9f76b,
where busy loop can be started with a request for following logs with a
range header set with num_skip value pointing beyond the end of the
journal. In that case the reader callback returns 0 and is called
immediately again, usually causing an endless loop that is not recovered
even when new journal events are added.

The bug does not occur if num_skip is not set - in that case if no
journal entries matching the filters are added, the tight loop is
avoided by the sd_journal_wait().

To fix the issue, when no matching journal events are available, set a
flag and reuse the backoff mechanism using the sd_journal_wait().

Link: https://github.com/home-assistant/operating-system/issues/4190
2025-07-31 12:32:10 +01:00
..