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

Inotify backend does not correctly handle one file being watched twice #30

Closed
povik opened this issue Aug 13, 2021 · 2 comments
Closed
Labels
v2 Ideas for v2

Comments

@povik
Copy link

povik commented Aug 13, 2021

If you start tailing the same file twice (by calling TailFile and supplying an identical filename), and are using the inotify backend, then only one of the Tail objects is notified when a line is appended to the file. Which one of the two objects gets notice is chosen at random, and the one which does then catches up on lines it has slept on in previous appends.

I would expect both of the objects to be notified at each append.

@povik povik added the bug Something isn't working label Aug 13, 2021
@povik
Copy link
Author

povik commented Aug 13, 2021

It boils down to the two Tail instances internally receiving on the same channel here. I would like to fix this but first I am interested in input on whether the interface provided by watch.Watch, watch.Events, watch.RemoveWatch and friends can have a breaking change. I would expect that no, it can't.

@nxadm nxadm added v2 Ideas for v2 and removed bug Something isn't working labels Nov 2, 2021
@nxadm
Copy link
Owner

nxadm commented Nov 2, 2021

That's correct, @povik. This looks like a breaking change for v2. I added a discussion thread here: #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2 Ideas for v2
Projects
None yet
Development

No branches or pull requests

2 participants