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

fix: Disable file watching on "ENOSPC: System limit for number of file watchers reached" error #895

Merged
merged 2 commits into from
Dec 13, 2022

Conversation

symwell
Copy link
Contributor

@symwell symwell commented Dec 9, 2022

When the indexer processes an appmap_dir that has more files than the OS limit for watching files, FSWatch raises an ENOSPC error. Catch this specific type of ENOSPC error and disable file watching. File changes continue to be detected through file polling.

Output of manual test. After disabling file watching, file polling continues to run.
file_watching_disabled

Fixes #894

If the reason for watching too many files was that the directory monitored wasn't precisely the appmap_dir but something more general, like . monitoring two parent directories up, then saving the appmap_dir in appmap.yml through this pr may be enough to make this ENOSPC error disappear without this fix.

This fix should still be applied because choosing to discard error messages instead of crash is still needed, as shown in #898

@symwell symwell force-pushed the sw/disable_watching_on_ENOSPC_error branch 6 times, most recently from 2d657c4 to 844c2ef Compare December 12, 2022 13:45
@symwell symwell marked this pull request as draft December 12, 2022 13:46
@symwell symwell force-pushed the sw/disable_watching_on_ENOSPC_error branch 4 times, most recently from ebbed03 to 47f5e4e Compare December 12, 2022 14:10
@symwell symwell marked this pull request as ready for review December 12, 2022 14:12
@symwell symwell force-pushed the sw/disable_watching_on_ENOSPC_error branch 2 times, most recently from 79b5dd3 to 9e6032a Compare December 12, 2022 16:46
@symwell symwell force-pushed the sw/disable_watching_on_ENOSPC_error branch from 9e6032a to 87b0a34 Compare December 12, 2022 19:45
Copy link
Contributor

@ahtrotta ahtrotta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like a good change to me. I have just a couple of minor comments.

packages/cli/src/fingerprint/fingerprintWatchCommand.ts Outdated Show resolved Hide resolved
packages/cli/src/fingerprint/fingerprintWatchCommand.ts Outdated Show resolved Hide resolved
…umber of file watchers reached" error is raised.

fix: Address feedback from code review
@symwell symwell merged commit 057b373 into main Dec 13, 2022
@symwell symwell deleted the sw/disable_watching_on_ENOSPC_error branch December 13, 2022 14:32
@appland-release
Copy link
Contributor

🎉 This PR is included in version @appland/appmap-v3.53.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

Indexer exits with Error: ENOSPC: System limit for number of file watchers reached
3 participants