tail
tail copied to clipboard
inotify_tracker logs fatal message without including error
I am using this library in production for years now and recently gotten in to more and more scenarios in which apps are crashing because watchers can not be created.
Describe the bug When a watcher can not be created the application crashes
watcher, err := fsnotify.NewWatcher()
if err != nil {
util.Fatal("failed to create Watcher")
}
https://github.com/nxadm/tail/blob/4472660a31a6f0014e888512303dc49785913d8b/watch/inotify_tracker.go#L220
Expected behaviour I either expect this operation to return the error value or at least for the error to be included in the fatal log message
To Reproduce
You would have to create a system state in which fsnotify.NewWatcher() returns an error.
I can't point out the error that caused it in my case, since it is not logged by the library.
This error occurs rarely in some of my containers, the majority work as expected.
System information
- tail version: latest
- OS: alpine in Docker
- Arch: amd64