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

Config setting to only yield complete lines #26

Merged
merged 9 commits into from
Dec 16, 2021

Conversation

kokes
Copy link
Contributor

@kokes kokes commented Apr 11, 2021

If a file writer doesn't flush line by line, it can (and does) happen that we get partial lines from the tailer. And worse, we can't even detect this and buffer these partials, because the library doesn't expose this fact.

This PR aims to change this - it learns from previous implementations that partially addressed this and introduces a new option (and thus is backwards compatible) to enable this explicitly.

(Discussed in #25.)

@kokes
Copy link
Contributor Author

kokes commented Apr 11, 2021

I'll check the failures next week.

@kokes
Copy link
Contributor Author

kokes commented Apr 11, 2021

Turns out I just misunderstood one of the test helpers and by not changing some names in tests, I created a race condition. Renaming those tests fixe the issue (tests still running, but I'm gonna call it 😁 ).

tail.go Outdated Show resolved Hide resolved
@kokes
Copy link
Contributor Author

kokes commented Nov 2, 2021

  • Accepted the change in strings.Builder allocation (though as noted in the issue, it won't make much a difference, because it is not used in the default flow).
  • Fixed tests, now using defer cleanup() in all of my code

@nxadm nxadm merged commit 4472660 into nxadm:master Dec 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants