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

BSD: Don't send ignored paths to kqueue #538

Closed
wants to merge 1 commit into from

Conversation

jcs
Copy link

@jcs jcs commented Apr 23, 2021

I'm using this via Jekyll's --watch option and on OpenBSD I either have to get a CPU-eating poll of its giant directory structure (because of .git and vendor/bundle) or I use rb-kqueue and the process quickly dies after running out of file handles.

Since the paths being ignored by the Silencer aren't used anyway, can it just not pass them to kqueue and avoid watching them?

kqueue requires a file handle for every file and directory being
watched so using Listen in a directory with .git or vendor/bundle
quickly eats up all available file handles.

Since these paths are being ignored by the silencer anyway, prevent
watching these paths to conserve file handles.
@ColinDKelley
Copy link
Collaborator

@jcs Thank you for the PR.

Can you please add tests? At least for these cases:

  • silenced by :dir
  • silenced by :file
  • not silenced

@ColinDKelley
Copy link
Collaborator

Hi @jcs Just checking in here to see if you can write those 3 tests?

@ColinDKelley
Copy link
Collaborator

Hi @jcs Just checking in again to see if you can write those 3 tests? LMK if you need help with them.

@ColinDKelley
Copy link
Collaborator

ColinDKelley commented Aug 19, 2021

@jcs Can you check out v3.7.0 that was just released and see if the optimization from #542 winds being equivalent to the kqueue optimization in this PR?

@jcs
Copy link
Author

jcs commented Aug 24, 2021

It appears so, thanks!

@jcs jcs closed this Aug 24, 2021
@ColinDKelley
Copy link
Collaborator

Excellent! Thanks @jcs for looking into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants