Skip to content

Prevent EMFILE #10432

Closed
Closed
@pravdomil

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.fsIssues and PRs related to the fs subsystem / file system.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions