Skip to content

fs: make rmdir() emfileWait handle ENFILE #30482

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.

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

    fsIssues and PRs related to file-system APIs and the fs module.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