-
Notifications
You must be signed in to change notification settings - Fork 129
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
watcher_fsevents: Fails to remove watch when directory does no longer exist #124
Comments
You could send a PR with the test itself, it can be executed on macos by travis. See https://github.com/rjeczalik/notify/blob/master/watcher_fsevents_test.go. |
@rjeczalik Also @ppknap name is in many comments on watcher_readdcw.go, so maybe he can have a look at those points as well. The issues I found/fixed are:
Unrelated: The debug logging is not very convenient. #128 adds option to enable debug logging via environment variable and adds timestamps to debug output. |
I forgot to close this in #129. |
Scenario:
Watch is set up at a dir, then this dir is removed (by user, so no control on it). Then
Stop
is called on this path, the dir is recreated and a new watch at dir is set up (with a new channel).What happens:
Creating the watch fails with error "path is already watched". Debug logs (where btw a timestamp would be very useful) show the following error after calling
Stop
:The full log of the tests where this error occurred can be found here:
https://build2.syncthing.net/viewLog.html?buildId=9782&buildTypeId=Syncthing_BuildMac&tab=buildLog&state=386&_focus=438#_state=386
What I would expect to happen:
As
Stop
does not report its status (no return value) it must leave a "consistent" state, e.g. remove the watches regardless of whether the path exists. OrWatch
shouldn't complain about the path already being watched and just send events on the channel provided with the existing watch (if it is still functional after the dir was removed at an earlier point).The following code should reproduce this problem, but I couldn't test as I don't have a system using fsevents:
The text was updated successfully, but these errors were encountered: