Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

unix: don't abort when out of FDs #1519

Closed
wants to merge 1 commit into from
Closed

Conversation

LinuxJedi
Copy link

When using uv_loop_new() and the system is low on FDs an abort will be
triggered due to uv_async_init() failing.

To fix this uv_async_init() has been moved up uv__loop_init() so that
allocations are not done before the FD creation and if the FD creation
fails we return -1. This will gracefully cause uv_loop_new() to fail so
the application can handle it.

Fixes #1510

When using uv_loop_new() and the system is low on FDs an abort will be
triggered due to uv_async_init() failing.

To fix this uv_async_init() has been moved up uv__loop_init() so that
allocations are not done before the FD creation and if the FD creation
fails we return -1.  This will gracefully cause uv_loop_new() to fail so
the application can handle it.
@saghul
Copy link
Contributor

saghul commented Oct 7, 2014

Thanks! This needs to be applied to the v1.x branch, not v0.10. Then we can think about backporting it.

Also, returning -1 might not be enough, uv__platform_loop_init was already called and we'd need to undo what was done there. If uv_loop_init fails the user is not expected to call uv_loop_close.

@LinuxJedi
Copy link
Author

ok, no problem, will resubmit in the next 24 hours to the correct branch.

Sorry, I was trying to do this before allocs but must have missed that. I'll get it to clean up appropriately.

@saghul
Copy link
Contributor

saghul commented Oct 7, 2014

Kewl, thanks!
On Oct 7, 2014 9:42 PM, "Andrew Hutchings" notifications@github.com wrote:

ok, no problem, will resubmit in the next 24 hours to the correct branch.

Sorry, I was trying to do this before allocs but must have missed that.
I'll get it to clean up appropriately.


Reply to this email directly or view it on GitHub
#1519 (comment).

@LinuxJedi
Copy link
Author

Closing this pull request to open a new one against v1.x branch as requested.

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

Successfully merging this pull request may close these issues.

4 participants