plumbing: format/packfile, prevent large objects from being read into memory completely#303
Merged
mcuadros merged 5 commits intogo-git:masterfrom May 12, 2021
Merged
Conversation
This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem. Objects greater than 1Mb are now no longer directly stored in the cache or read completely into memory. Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
jfontan
reviewed
Apr 22, 2021
Member
|
@zeripath Thanks for the PR. I like the changes but I'm a little worried of using a goroutine for the reader. Do you think it can be done without using it? |
Signed-off-by: Andrew Thornton <art27@cantab.net>
Signed-off-by: Andrew Thornton <art27@cantab.net>
jfontan
approved these changes
Apr 22, 2021
Contributor
Author
|
So before you merge this, there are a couple of questions that we should think about:
Many thanks for your work on this |
Contributor
Author
|
Sorry I've taken so long to answer my own questions here.
This is fine - it's only when you get the reader that you actually do the reading.
This is also probably fine. |
12 tasks
3 tasks
zeripath
added a commit
to zeripath/go-git
that referenced
this pull request
May 27, 2021
Unfortunately the code in go-git#303 was incorrect for large objects in OFS deltas. The underlying fault is that the seeker in the packfile was seeking away whilst the delta was being read. This PR simply reads the delta into a buffer. Fix go-git#323 Signed-off-by: Andrew Thornton <art27@cantab.net>
This was referenced Jun 2, 2021
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.
This PR adds code to prevent large objects from being read into memory from packfiles or the filesystem.
Objects greater than 1Mb are now no longer directly stored in the cache
or read completely into memory.
Signed-off-by: Andrew Thornton art27@cantab.net