Axosoft / nsfw

A super fast and scaleable file watcher that provides a consistent interface on Linux, OSX and Windows
MIT License
902 stars 112 forks source link

"Service shutdown unexpectedly" when deleting the root watched folder #56

Open Tyriar opened 6 years ago

Tyriar commented 6 years ago

See https://github.com/Microsoft/vscode/issues/29590, the repro is pretty easy in VS Code. Just enable NSFW and then delete the root folder.

bpasero commented 3 years ago

This still reproduces with latest.

bpasero commented 2 years ago

@implausible turns out when I simply remove this check for stat:

https://github.com/Axosoft/nsfw/blob/e8a6e953b5ec4ed09b1e73cea944fcfc6149ea3e/src/osx/FSEventsService.cpp#L90

Changes happily work even after restoring the folder. It seems to me that FSEventStreamCreate is robust for deletes like that? This also explains why fsevents lib recovers nicely.