8000 Promise rejection: build Error: EMFILE: too many open files · Issue #2288 · microsoft/vscode-cmake-tools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Promise rejection: build Error: EMFILE: too many open files #2288
Closed
@nehaljwani

Description

@nehaljwani

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature: cpptools integrationbuga bug in the producthelp wantedwe currently are not planning work on this and would like help from the open source community

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0