Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

transient EPERM errors on Windows #303

Open
lukekarrys opened this issue Apr 21, 2024 · 4 comments · May be fixed by #322
Open

transient EPERM errors on Windows #303

lukekarrys opened this issue Apr 21, 2024 · 4 comments · May be fixed by #322

Comments

@lukekarrys
Copy link

lukekarrys commented Apr 21, 2024

I always reach for rimraf when I hit Windows specific filesystem errors. This eliminates them and then I don't have to think about Windows specific filesystem errors.

I recently hit a case that rimraf didn't fix. When trying to remove a 25mb exe file on CI in Windows, I would get EPERM errors that rimraf would eventually throw on. I eventually found two work arounds:

  • Retry on EPERM errors. In one case it took 4 seconds before it finally worked.
  • Use rimraf.moveRemove directly

I think both of those fixes could be applied in rimraf but I'm not sure which would be safer for general use. Having looked at the code I think the options would be:

@isaacs
Copy link
Owner

isaacs commented Apr 21, 2024

I think falling back to moveRemove right away is the better approach. Retrying for 4 seconds is pretty brutal, and if it's just single files here and there, then moveRemove wouldn't be too terrible.

@mark-wiemer
Copy link

@lukekarrys do you have a fork of this with the proposed patches applied to see the perf difference, by chance?

@lukekarrys
Copy link
Author

I have a PR open in my fork where I am experimenting with fixing the EPERM errors but I haven't checked out performance there yet: lukekarrys#1

@lukekarrys
Copy link
Author

I also have #320 which allows for filtering and comparing benchmarks. But I haven't tried to get any definitive results yet since I switched over to trying another method to fix the EPERM errors.

@lukekarrys lukekarrys linked a pull request Oct 10, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants