-
Notifications
You must be signed in to change notification settings - Fork 44
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
await_next_record
seems to return old records while triggering on new records.
#66
Comments
Here's how I had to fix it: let mut log = Journal::open(systemd::journal::JournalFiles::All, true, true)
.expect("unable to open systemd journal");
loop {
while let Ok(Some(record)) = log.next_record() {
... send the existing records somewhere
}
if let Ok(Some(record)) = log.await_next_record(None) {
... send the next records somewhere
}
} |
Hmm, yeah, |
There will always be a race condition if I do that: what if a log record appears between the ‘seek‘ and the ‘await_next_record‘ ? |
Internally,
The issue with calling that repeatedly is that we The right way to do this (in sd-journal apis) is something like:
so:
|
#124 helps this. I've added an example of using the low-level interfaces and made |
In my executable one my my threads basically does:
and apparently this triggers on new log entries, but returns one old new entry each time (i.e. I see it displaying kernel boot entries, one line at a time, instead of what is happening now).
The text was updated successfully, but these errors were encountered: