-
Notifications
You must be signed in to change notification settings - Fork 47
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
InotifyBackend hungs forever when inotify_init1 returns error #159
Comments
amierzwicki
changed the title
InotifyBackend hungs forever when
InotifyBackend hungs forever when inotify_init1 returns error
Oct 16, 2023
(Just as FYI for possible crawlers with the same problem than I had) I encountered this bug as well during a
And stuck here forever. GDB helped me to trace the issue here:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Scenario
Sytem: linux (ubuntu 22.04)
When there are too many open inotify instances the
parcel build
will hung without any clue to why it's stuck.Expected behavior
Parcel should throw clear exception - e.g. "There are too many open files, cannot initialize inotify instance"
Stretch goal
Suggest to user what are possible actions to fix it (e.g. writing higher value to
/proc/sys/fs/inotify/max_user_instances
).Current behavior
When there are too many open inotify instances the inotify_init1 returns -1 with errno "Too many open files". This causes exception in InotifyBackend: https://github.com/parcel-bundler/watcher/blob/master/src/linux/InotifyBackend.cc#L25.
When this happens the
Backend::run
will block forever due to insufficient error handling (https://github.com/parcel-bundler/watcher/blob/master/src/Backend.cc#L103):The fix will require a bit more than just calling
mStartedSignal.notify()
(error needs to be populated up the stack) - the above just highlights in what state the process ends up when this error happens.Steps to reproduce
/proc/sys/fs/inotify/max_user_instances
to some small value (e.g. 1)Workaround
Naturally the problem of too many inotify instances needs to be fixed (even when this bug will be resolved) - either by closing old processes in system or by increasing the limit
echo 256 | sudo tee /proc/sys/fs/inotify/max_user_instances
(default is often 128).The text was updated successfully, but these errors were encountered: