Skip to content

fs: treat std::errc::permission_denied as EPERM error#64698

Open
PickBas wants to merge 2 commits into
nodejs:mainfrom
JaneaSystems:win-rmsync-eperm-retry-test
Open

fs: treat std::errc::permission_denied as EPERM error#64698
PickBas wants to merge 2 commits into
nodejs:mainfrom
JaneaSystems:win-rmsync-eperm-retry-test

Conversation

@PickBas

@PickBas PickBas commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

std::errc::permission_denied is already treated as an EPERM error when an exception is thrown, but it is not included among the omittable errors retried by the RmSync operation. This commit adds it.

This also fixes the retryDelay calculation on Windows where the retryDelay is divided by 1000 but the win32's Sleep function takes the argument as an ms unit, dividing the supplied ms unit further to a much smaller delay.

Fixes: #64016
Refs: #64017 - This PR adds a test for the referenced PR.

In the thrown exception, `std::errc::permission_denied` is already
treated as an `EPERM` error, but it is not included in one of the
omittable errors when retrying the `RmSync` operation. This commit
includes it.

This also fixes the `retryDelay` calculation on Windows where the
`retryDelay` is divided by `1000` but the win32's `Sleep` function
takes the argument as an `ms` unit, dividing the supplied `ms` unit
further to a much smaller delay.

Signed-off-by: louiellan <louie.lou.llaneta@gmail.com>
@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Jul 23, 2026
Comment thread test/parallel/test-fs-rmSync-eperm-retries.js Outdated
Comment thread src/node_file.cc
@PickBas
PickBas force-pushed the win-rmsync-eperm-retry-test branch from 092d380 to b5441d9 Compare July 23, 2026 13:23
@PickBas
PickBas force-pushed the win-rmsync-eperm-retry-test branch from b5441d9 to 977185e Compare July 23, 2026 13:31
Fixes: nodejs#64016
Signed-off-by: PickBas <sayed.kirill@gmail.com>
@PickBas
PickBas force-pushed the win-rmsync-eperm-retry-test branch from 977185e to 7cf7983 Compare July 23, 2026 13:39
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.13%. Comparing base (e6a8d06) to head (7cf7983).
⚠️ Report is 424 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #64698      +/-   ##
==========================================
- Coverage   92.01%   90.13%   -1.89%     
==========================================
  Files         379      741     +362     
  Lines      166972   242158   +75186     
  Branches    25554    45602   +20048     
==========================================
+ Hits       153639   218268   +64629     
- Misses      13041    15386    +2345     
- Partials      292     8504    +8212     
Files with missing lines Coverage Δ
src/node_file.cc 74.23% <ø> (ø)

... and 566 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Inconsistent retryDelay in fs.rmSync and asynchronous fs.rm (on Windows)

4 participants