Sitelet https://github.com/nodejs/node/issues/10432
Skip to content

Prevent EMFILE #10432

Description

@pravdomil

Try to run (with empty file.txt in working dir):

for(let i = 0; i < 10e3; i++) { require('fs').watch('file.txt') }

Produces instantly: Uncaught Error: watch file.txt EMFILE

It make sense to dedupe multiple watchers on same file to prevent 'too many files open'?

  • Version: v7.2.1
  • Platform: macOS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.fsIssues and PRs related to file-system APIs and the fs module.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions