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

busyTries implementation can cause extremely long wait times #187

Closed
TanninOne opened this issue Mar 4, 2019 · 2 comments
Closed

busyTries implementation can cause extremely long wait times #187

TanninOne opened this issue Mar 4, 2019 · 2 comments

Comments

@TanninOne
Copy link

On Windows, if busyTries are configured and rimraf encounters an EPERM/ENOTEMPTY/EBUSY error it will retry that call several times, with a bit of a delay.
So far so good. Problem is: Once the tries are used up, it will rethrow that same error to the recursion level further up - which will then also retry.

So imagine you have the directory foo/bar/protected, protected is write protected, you call rimraf('foo') with the default of 3 busy tries.
Effectively this will try to delete foo 3 times, which will try to delete foo/bar 9 times which will try to delete foo/bar/protected 27 times - each attempt being delayed on average by 100ms for a total wait time of almost 4 seconds when it should be 300ms.
Have a directory tree of 6 levels deep and the call takes 2 minutes before it fails - instead of 300ms - and so on.

@isaacs
Copy link
Owner

isaacs commented Jan 13, 2023

I'll have to check if this is still an issue in v4. Seems like it should have a way to tell the parent call that we're giving up now.

@isaacs isaacs closed this as completed in 8ade1b6 Jan 13, 2023
@isaacs
Copy link
Owner

isaacs commented Jan 13, 2023

Yep. Fixed it by only retrying if the EBUSY (etc) is raised by the specific thing being deleted.

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

No branches or pull requests

2 participants