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

Concurrent usage of tail results in unexpected behavior #41

Open
lovromazgon opened this issue Apr 15, 2022 · 1 comment
Open

Concurrent usage of tail results in unexpected behavior #41

lovromazgon opened this issue Apr 15, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@lovromazgon
Copy link

Describe the bug
If two (or more) goroutines are tailing the same file and one of them stops it impacts the other goroutine(s).

Expected behaviour
Other goroutines should keep on tailing the file.

To Reproduce
See this test.

It runs three goroutines, one will continuously write to a file every 500 milliseconds, the other two will each tail the same file. The writing goroutine runs for 5 seconds, the first tailing goroutine runs for 2 seconds and the second tailing goroutine runs for 4 seconds.

The expectation is that the second goroutine would keep on tailing the file after the first one stops, but that is not the case.

System information

  • tail version 1.4.8
  • OS: macOS Monterey 12.3.1
  • Arch: amd64

Additional context
The issue is (presumably) that both goroutines use the same underlying watcher and after one stops the watcher is removed.

@lovromazgon lovromazgon added the bug Something isn't working label Apr 15, 2022
@lovromazgon
Copy link
Author

lovromazgon commented Apr 15, 2022

I just realized there's a closed issue that points out this problem already #30.

Scratch that, it's not the same.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant