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

Wait longer for rename lock contention to resolve #97

Merged
merged 1 commit into from
Nov 2, 2016
Merged

Wait longer for rename lock contention to resolve #97

merged 1 commit into from
Nov 2, 2016

Conversation

sam-github
Copy link
Contributor

Anti-virus software on Windows can lock files for long periods of time,
and graceful-fs was only waiting up to a second, and busy-looping during
that wait, which has the potential to starve the locker of CPU.

Fixes npm/npm#12059

fs$rename(from, to, CB);
}, backoff)
if (backoff < 100)
backoff += 10;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't there be a return here? Otherwise it'll call the callback on every iteration of the retry.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I'm sorry. @aldenchan, take notice of above, I pushed a fixup.

Anti-virus software on Windows can lock files for long periods of time,
and graceful-fs was only waiting up to a second, and busy-looping during
that wait, which has the potential to starve the locker of CPU.
@isaacs isaacs merged commit 59145ce into isaacs:master Nov 2, 2016
@sam-github
Copy link
Contributor Author

Thank you, @isaacs

@sam-github
Copy link
Contributor Author

Any idea what the timeline is for this to be available via npm?

othiym23 added a commit to npm/npm that referenced this pull request Nov 4, 2016
Better backoff for EPERM on Windows.

Credit: @sam-github
Fixes: #12059
Reviewed-By: @othiym23
Reviewed-By: @isaacs
PR-URL: isaacs/node-graceful-fs#97
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 this pull request may close these issues.

2 participants