fixed win32 p_unlink retry sleep issue#4312
Closed
cjhoward92 wants to merge 3 commits into
Closed
Conversation
added 3 commits
July 18, 2017 14:47
Fixed an issue where the retry logic on p_unlink sleeps before it tries setting a file to write mode causing unnecessary slowdown.
Contributor
Author
|
Did not notice this PR. |
Member
|
Heh, you've been late by only 5 minutes. Thanks anyway for your PR! |
Contributor
Author
|
@pks-t Yeah! I was little bummed but that's okay as long as it gets fixed! Thank you for helping to maintain the library! It's great. |
ethomson
added a commit
that referenced
this pull request
Jul 26, 2017
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.
Member
|
Yeah, sorry again for the poor communication on my part @cjhoward92. I'm manually merging your pull request into my branch, because I want to make sure that your change gets in to the code base. 😀 I've rebased my change on top, since I think that it's a little bit more general-purpose, and I'll merge them both in #4311. Thanks again for the investigation and the fix! 🎉 |
Contributor
Author
|
Wow thanks @ethomson! Appreciate it! |
swisspol
pushed a commit
to git-up/libgit2
that referenced
this pull request
Feb 4, 2018
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 libgit2#4312.
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.
Fixed an issue where the retry logic on
p_unlinkinposix_w32.csleeps before it tries setting a file to write mode causing unnecessary slowdown.This affects windows only.
The issue was introduced in this commit as the
do_with_retriesmacro tries theunlink_onceroutine and sleeps on failure before callingensure_writable.This is particularly noticeable when staging large groups of files at once as staging creates a temporary git object that is set to read only. When this temporary git object is deleted via
p_unlinkit always ends up hitting the sleep causing a 5ms delay per file.I spoke with @ethomson on slack about this briefly.