mirror of
https://github.com/containers/podman.git
synced 2025-05-21 09:05:56 +08:00
performance fix for podman events with large journalds
in the case where the host has a large journald, iterating the journal without using a Match is very poor performance. this might be a temporary fix while we figure out why the systemd library does not seem to behave properly. Signed-off-by: baude <bbaude@redhat.com>
This commit is contained in:
@ -73,6 +73,11 @@ func (e EventJournalD) Read(options ReadOptions) error {
|
|||||||
if err := j.SeekTail(); err != nil {
|
if err := j.SeekTail(); err != nil {
|
||||||
return errors.Wrap(err, "failed to seek end of journal")
|
return errors.Wrap(err, "failed to seek end of journal")
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
podmanJournal := sdjournal.Match{Field: "SYSLOG_IDENTIFIER", Value: "podman"} //nolint
|
||||||
|
if err := j.AddMatch(podmanJournal.String()); err != nil {
|
||||||
|
return errors.Wrap(err, "failed to add filter for event log")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// the api requires a next|prev before getting a cursor
|
// the api requires a next|prev before getting a cursor
|
||||||
if _, err := j.Next(); err != nil {
|
if _, err := j.Next(); err != nil {
|
||||||
|
Reference in New Issue
Block a user