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

Filewatching fails silently with >4096 paths #48

Open
maiamcc opened this issue Jun 12, 2020 · 3 comments
Open

Filewatching fails silently with >4096 paths #48

maiamcc opened this issue Jun 12, 2020 · 3 comments

Comments

@maiamcc
Copy link

maiamcc commented Jun 12, 2020

Before reporting an issue, please ensure you are using the latest release of fsevents.

Which version of macOS are you using?

ProductName:	Mac OS X
ProductVersion:	10.15.4
BuildVersion:	19E287

Please describe the issue that occurred.

Filewatching with fsevents.EventStream works just fine for up to 4096 paths; from 4097 paths upwards, I don't seem to be getting any events (nor error messages).

Are you able to reproduce the issue? Please provide steps to reproduce and a code sample if possible.

Repro case here (a small Go util that watches files specified as args, plus repro instructions).

FWIW, I think this may be an underlying problem with fsevents (because I could reproduce the problem with e.g. this fswatch util), but I'm not sure where to report; would be happy for guidance!

@pbnjay
Copy link
Contributor

pbnjay commented Jan 15, 2022

Confirmed still an issue on 11.5.2, thanks for the repo case!
As mentioned in the linked issue, I can confirm it is associated with #37 when the FSEventStreamStart returns 0.

One workaround that is actually more performant on macOS is to simply watch the containing folder e.g. for your repro case you can use go run main.go ./files (but this does not match the expected semantics if you want a subset for 4097 files).

@nathany nathany changed the title Filewatching fails silently with >4096 files Filewatching fails silently with >4096 paths Jan 19, 2022
@nathany
Copy link
Contributor

nathany commented Jan 19, 2022

Maybe we should update the README with this limit?

@pbnjay
Copy link
Contributor

pbnjay commented Jan 19, 2022

I can include a README update with the changes I have queued for #37 . Trying to clean up the tests this evening

pbnjay added a commit to pbnjay/fsevents that referenced this issue Jan 19, 2022
arp242 added a commit that referenced this issue Oct 14, 2022
* Return an error if FSEventStreamStart fails

* Validate the 4096 path limit and error detection

* Add notes for #46 and #48 limitations of macOS

Co-authored-by: Martin Tournoij <martin@arp242.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants