Skip to content

Commit

Permalink
Skip journald bad message. (#2928)
Browse files Browse the repository at this point in the history
Unfortunatelly I can't show the message itself without forking the library
we are using.

Fixes #2812.

Signed-off-by: Cyril Tovena <[email protected]>
  • Loading branch information
cyriltovena authored Nov 17, 2020
1 parent 78bb4bc commit 58f8117
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions pkg/promtail/targets/journal/journaltarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,14 @@ func journalTargetWithReader(
}

go func() {
err := t.r.Follow(until, ioutil.Discard)
if err != nil && err != sdjournal.ErrExpired {
level.Error(t.logger).Log("msg", "received error during sdjournal follow", "err", err.Error())
for {
err := t.r.Follow(until, ioutil.Discard)
if err != nil {
if err == sdjournal.ErrExpired || err == io.EOF {
return
}
level.Error(t.logger).Log("msg", "received error during sdjournal follow", "err", err.Error())
}
}
}()

Expand Down

0 comments on commit 58f8117

Please sign in to comment.