Add an mtime file watcher.#549
Conversation
|
This can help us work around the issues caused by inotify-style watchers. |
|
TODO:
|
|
In other projects, I've been very satisfied with using https://facebook.github.io/watchman/ It's a separate service that's optimized for efficient file watching on major operating systems. It supports features like a logical clock and providing a digest of fes when they change. There's a json or binary protocol that's accessible via a Unix socket. |
SGTM, how about an environment variable to switch between the two for now in-case there is a large perf hit for some workloads? We can switch the default to mtime in this PR but leave inotify until we stop hearing complaints about mtime. |
|
An env var would be easier than a flag because we can remove it without breaking people that pass it on the cmd line. |
fa89fb4 to
3e24a8f
Compare
|
Dropping the WIP, this should be ready for a look. I prioritized ease-of-removal of fsnotify rather than doing a full refactor. |
|
These tests are passing for me but failing in travis, i'll keep debugging: --- PASS: TestWatch (5.03s)
--- PASS: TestWatch/watch_unknown_file_mtime (0.00s)
--- PASS: TestWatch/write_files_mtime (2.01s)
--- PASS: TestWatch/ignore_file_mtime (2.00s)
--- PASS: TestWatch/watch_unknown_file_fsnotify (0.00s)
--- PASS: TestWatch/write_files_fsnotify (0.51s)
--- PASS: TestWatch/ignore_file_fsnotify (0.51s) |
8816d5b to
b46dfde
Compare
|
Tests passing now. |
|
I think we should do some testing with minikube/d4d to make sure this works well. We still have the clock skew issues in minikube. |
The skew isn't important, we take an initial snapshot then just check to see if the values have changed at all from that. What exactly do you mean by testing in d4d? Watch happens on the local machine, not in the build step itself. |
|
@dlorenc I'm sorry you have to rebase the code. |
This watcher is on by default, but the old one can be enabled by setting: SKAFFOLD_FILE_WATCHER=fsnotify The old one will be removed after a release.
|
@dgageot anything blocking this? |
|
Absolutely not! Let me merge it |
No description provided.