-
-
Notifications
You must be signed in to change notification settings - Fork 725
feat(watch): migrate to fsnotify #2048
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
Conversation
07524dd
to
09f9211
Compare
09f9211
to
15fff10
Compare
15fff10
to
fda3226
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having issues where if a directory is empty when I start the watcher and then create files, nothing will be detected. If I create any file before starting the watcher, then other new files are detected.
I'm also not able to get deletes to work (on Linux). When I remove a file, I just get something like this:
task: received watch event: WRITE ".../testdata/watcher_interval/src/foo.txt"
task: skipped for file not in sources: src/foo.txt
But it does not start the task.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm having issues where if a directory is empty when I start the watcher and then create files, nothing will be detected. If I create any file before starting the watcher, then other new files are detected.
I've observed the same thing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still going to work on this issue another day.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
96a6691
to
f76d72f
Compare
614c656
to
13168c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is looking good now! (At least on Linux). I can't see any unexpected behaviour and the previously mentioned issues seem to be fixed. Performance also seems much better than before.
I can't speak to the remaining points around ulimits on MacOS (I don't own any Apple hardware), but it seems like regardless of that issue, this is a big step forwards and those things could be addressed separately if required. I think for most users, the default ulimit will be enough and CGO
seems like a line we can't cross in Task anyway.
I'm merging this as this is an significant improvement on it already. We can still do further improvements with time. 🙂 |
We're migrating from watcher to fsnotify, which is more performant and will avoid issues with high CPU usage.
This will close the following issues:
-w
#985TODO:
fsnotify
recommends us to watch directory instead of individual files.internal/fingerprint
to return only the directories and watch for those.sources
.Mark the--interval
flag andinterval:
setting as deprecated. We should probably emit a warning if set, as from now on these will be ignored.Possible post-launch improvements: