forked from src-d/go-git
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Adapted non-force fetching with locking #1
Closed
Closed
Changes from 1 commit
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
86e75a5
Update README.md
bzz bb3217c
Merge pull request #585 from src-d/doc/upd-linl
mcuadros 841b62a
plumbing: the commit walker can skip externally-seen commits
strib 52c1f98
config: support a configurable, and turn-off-able, pack.window
strib 032ec28
Merge pull request #587 from keybase/strib/skip-compression-gh-master
mcuadros 8cb0215
Merge pull request #586 from keybase/strib/commit-preorder-seen-gh-ma…
mcuadros 5bb64f6
revlist: do not revisit ancestors as long as all branches are visited
erizocosmico 7d1595f
Merge pull request #588 from erizocosmico/perf/revlist-norevisit-ance…
mcuadros 9e2a811
Add a Force flag to Fetch and Clone, mimicking the command-line client
b3363d3
Use optionally locking when updating refs
taruti 481ece0
Document Lock+Close usage
taruti 7da91ff
Fetch - honor per refspec force flag
taruti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
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 corresponding
f.Unlock()
somewhere, maybe as adefer
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually Close takes care of it, but should probably document that. (If we were unlocking the file it would probably(?) need a fsync before the unlock, but go-billy lacks fsync too).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@taruti: I don't understand how
Close()
takes care of it. Is that a new requirement of thebilly.File.Close()
method? Our current implementation doesn't do that, though I guess maybe for posfix flock and Windows,Close()
handles it automatically? We will need something that explicitly callsUnlock()
on our ownlibfs.File
implementation; iflibfs.File.Close()
is supposed to do that, we can make that happen. Was just confused. A comment here would definitely help, and maybe one over ingo-billy
as well if that's a new assumption.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But flocks are released by closing the file? From e.g. Linux
Furthermore, the lock is released either by an explicit LOCK_UN operation on any of these duplicate file descriptors, or when all such file descriptors have been closed.
. But yes more documentation would be good.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Our implementation of file locking will run into trouble with other applications if we keep the locks after all file descriptors are closed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The implementation of our KBFS locks won't be flock-based, so we'll need some way to know to release them. Doing it as part of the
Close()
call is totally fine, we should just document it.(@songgao -- we should change our
libfs.File.Close()
method to callUnlock()
).