Skip to content

fs: make rmdir() emfileWait handle ENFILE #30482

Closed
@bnoordhuis

Description

@bnoordhuis
  1. EMFILE: current process is out of file descriptors
  2. ENFILE: system is out of file descriptors

The fs.rmdir() logic in lib/internal/fs/rimraf.js currently handles the former but not the latter:

if (err.code === 'EMFILE' && timeout < options.emfileWait)
return setTimeout(_rimraf, timeout++, path, options, CB);

Both are (hopefully) transient errors though and should be handled identically.

Since ENFILE is difficult to test for, I think it's okay to omit a regression test.

Metadata

Metadata

Assignees

No one assigned

    Labels

    fsIssues and PRs related to the fs subsystem / file system.good first issueIssues that are suitable for first-time contributors.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions