win32: provide fast-path for retrying filesystem operations#4311
Merged
win32: provide fast-path for retrying filesystem operations#4311
Conversation
implausible
added a commit
to implausible/nodegit
that referenced
this pull request
Jul 19, 2017
Also stack along performance PRs libgit2/libgit2#4311 and libgit2/libgit2#4205
Fixed an issue where the retry logic on p_unlink sleeps before it tries setting a file to write mode causing unnecessary slowdown.
When using the `do_with_retries` macro for retrying filesystem operations in the posix emulation layer, allow the remediation function to return `GIT_RETRY`, meaning that the error was believed to be remediated, and the operation should be retried immediately, without a sleep. This is a slightly more general solution to the problem fixed in #4312.
1af0c01 to
bc35fd4
Compare
Member
Author
|
Thanks @cjhoward92 ! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using the
do_with_retriesmacro for retrying filesystem operations in the posix emulation layer, allow the remediation function to returnGIT_RETRY, meaning that the error was believed to be remediated, and the operation should be retried immediately, without a sleep.Use this in the
ensure_writableremediation function - if the function is able to set the file writable, then retry the operation immediately. This will prevent a 5ms sleep in the common case.