tail
tail copied to clipboard
StopAtEOF is racy
If you sent an issue/PR to hpcloud, you can have a look at this meta issue tracking issues and PRs of the dormant upstream. However, as the code bases diverge the issue may have been solved already.
Describe the bug
The StopAtEOF function can sometimes stop tailing the file before we actually encounter an EOF. In particular, when using the polling function for checking for file changes, we might select this tail.Dying channel here first before the poller gets another chance to notify us of new changes, which I believe makes us then return here, even though we should probably be waiting for another poll cycle.
Expected behaviour
The library checks again for new changes in the file after StopAtEOF is reached.
To Reproduce
This is a bit awkward to reproduce, since it's based on racyness. However tailing a file that's being written to in short intervals, and calling StopAtEOF might not return all data before exiting.
Additional context I'd be happy to contribute a PR for this, but probably won't have the time to do so before next week.