Skip to content
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

Do not flush FSEventStream #96

Merged
merged 1 commit into from
Feb 18, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/main/cpp/apple_fsnotifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,16 @@ void Server::run() {

CFRunLoopRun();

FSEventStreamFlushSync(watcherStream);
// Reading the Apple docs it seems we should call FSEventStreamFlushSync() here.
// But doing so produces this log:
//
// 2020-02-17 23:02 java[50430] (FSEvents.framework) FSEventStreamFlushSync(): failed assertion '(SInt64)last_id > 0LL'
//
// According to this comment we should not use flush at all, and it's probably broken:
// https://github.com/nodejs/node/issues/854#issuecomment-294892950
// As the comment mentions, even Watchman doesn't flush:
// https://github.com/facebook/watchman/blob/b397e00cf566f361282a456122eef4e909f26182/watcher/fsevents.cpp#L276-L285
// FSEventStreamFlushSync(watcherStream);
FSEventStreamStop(watcherStream);
FSEventStreamInvalidate(watcherStream);

Expand Down