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 crash when folder watcher fails #251

Merged
merged 1 commit into from
Jan 14, 2023
Merged

Conversation

davidnewhall
Copy link
Collaborator

This fixes the bug provided in #248.

What happens: When the app starts it initializes an fsnotify structure, but if no folders are defined it does not use it. If this initialization fails, for any reason, the app now has an uninitialized data structure and later crashes when it tries to read it. The bug discovered shows a failure in this initialization due to too many open files. Never seen this, and this bug has never been brought up until now.

So, to fix it, I did two things.

  1. We no longer initialize fsnotify if there are no folders defined. This will avoid the too many open files problem.
  2. If the fsnotify initialization fails, we still create the data structure to avoid crashing the app.

@davidnewhall davidnewhall merged commit 450b974 into master Jan 14, 2023
@davidnewhall davidnewhall deleted the dn2_folder_crash branch January 14, 2023 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant