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

Promise rejection: build Error: EMFILE: too many open files #2288

Closed
nehaljwani opened this issue Dec 13, 2021 · 2 comments · Fixed by #2439
Closed

Promise rejection: build Error: EMFILE: too many open files #2288

nehaljwani opened this issue Dec 13, 2021 · 2 comments · Fixed by #2439
Labels
bug a bug in the product Feature: cpptools integration help wanted we currently are not planning work on this and would like help from the open source community
Milestone

Comments

@nehaljwani
Copy link

On a project with a huge number of build targets and with a capped ulimit on nofile, the CMake configure stage is marked as failed (although CMake itself succeeds). And on triggering the build step, it fails with:

[rollbar] Unhandled exception: Unhandled Promise rejection:
build Error: EMFILE: too many open files,
open '/path/to/builddir/.cmake/api/v1/reply/target-<redacted>o-Release<hash>.json' {}

The problem is that the following snippet:

const targetsList = Promise.all(configuration.targets.map(
t => convertTargetObjectFileToExtensionTarget(builddir, path.join(reply_path, t.jsonFile))));

Calls the following for each file with no consideration to limits and no retries:

const targetObject = await loadTargetObject(file_path);

Yes, this problem can be worked around with increasing the sysctl for fs.inotify.max_user_watches or updating /etc/security/limits.conf, but that assumes that every developer has admin access or can get an admin to make this change for them, which is not always possible.

I found several discussions at https://stackoverflow.com/q/8965606/1005215 , perhaps this project can adopt one of them?

@bobbrow
Copy link
Member

bobbrow commented Dec 16, 2021

Thanks for reporting this. We'll see what we can do, but will also accept a PR if someone who has a repro wants to help out.

@bobbrow bobbrow added the help wanted we currently are not planning work on this and would like help from the open source community label Dec 30, 2021
@bobbrow
Copy link
Member

bobbrow commented Mar 30, 2022

This was fixed yesterday and is available in today's pre-release build, version 1.11.2.

@bobbrow bobbrow added this to the 1.11.0 milestone Mar 30, 2022
@bobbrow bobbrow linked a pull request Mar 30, 2022 that will close this issue
@bobbrow bobbrow closed this as completed Apr 20, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug a bug in the product Feature: cpptools integration help wanted we currently are not planning work on this and would like help from the open source community
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants