Skip to content
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

log death reason of file reader if available #2721

Merged
merged 1 commit into from Jan 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 8 additions & 3 deletions pkg/acquisition/modules/file/file.go
Expand Up @@ -453,9 +453,14 @@
}
return nil
case <-tail.Dying(): //our tailer is dying
logger.Warningf("File reader of %s died", tail.Filename)
t.Kill(fmt.Errorf("dead reader for %s", tail.Filename))
return fmt.Errorf("reader for %s is dead", tail.Filename)
err := tail.Err()
errMsg := fmt.Sprintf("file reader of %s died", tail.Filename)
if err != nil {
errMsg = fmt.Sprintf(errMsg+" : %s", err)
}
logger.Warningf(errMsg)
t.Kill(fmt.Errorf(errMsg))
return fmt.Errorf(errMsg)

Check warning on line 463 in pkg/acquisition/modules/file/file.go

View check run for this annotation

Codecov / codecov/patch

pkg/acquisition/modules/file/file.go#L456-L463

Added lines #L456 - L463 were not covered by tests
case line := <-tail.Lines:
if line == nil {
logger.Warningf("tail for %s is empty", tail.Filename)
Expand Down