-
Notifications
You must be signed in to change notification settings - Fork 100
midx: verify: add midx packfiles to the packed_git list #121
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
midx: verify: add midx packfiles to the packed_git list #121
Conversation
Fix "git multi-pack-index verify" to handle repos with thousands of packfiles. Midx verify adds the individual "packed_git" structures to the multi_pack_index.packs array, but it does not add them to the "repository.objects.packed_git" list. During the verification code, each packfile is opened and scanned. And "pack_open_fds" is incremented. If "pack_open_fds" equals the "pack_max_fds" open_packed_git_1() calls close_one_pack() to LRU-style close an already open packfile. But because the packfiles were never added to the "packed_git" list, close_one_pack() does nothing. If there are very many packfiles, Git runs out of file descriptors and fails. Note that this was observed on Windows when build with GCC and in a repository with more than (2048-25) packfiles. Signed-off-by: Jeff Hostetler <[email protected]>
midx: verify: add midx packfiles to the packed_git list
@jeffhostetler sorry that this was a pain point, and that I didn't see it until you posted the patches to the mailing list. This makes me think there is a bigger issue with the midx during a normal read: if the user ran Likely the full solution requires these steps:
That sounds like a lot of work, and I'm sorry for my oversight on this file handle limit. |
@derrickstolee Thanks for the info. And NP. I think all that makes sense. I had tried several different ways to get the midx packfiles properly The 2 line fix here helped untangle that, but yes getting rid of the 2 distinctions and having a The fix here only affects I think I'd like to drop the contents of this PR from the upstream PR Thanks! |
@jeffhostetler you are absolutely right to do this fix first, as it is definitely causing issues. I mention a larger fix to take care of all possible issues, but we may not have hit them in the wild (although, Another way to try and fix this is to add the |
Fix "git multi-pack-index verify" to handle repos with thousands
of packfiles.
Midx verify adds the individual "packed_git" structures to the
multi_pack_index.packs array, but it does not add them to the
"repository.objects.packed_git" list. During the verification
code, each packfile is opened and scanned. And "pack_open_fds"
is incremented. If "pack_open_fds" equals the "pack_max_fds"
open_packed_git_1() calls close_one_pack() to LRU-style close
an already open packfile. But because the packfiles were never
added to the "packed_git" list, close_one_pack() does nothing.
If there are very many packfiles, Git runs out of file descriptors
and fails.
Note that this was observed on Windows when build with GCC and
in a repository with more than (2048-25) packfiles.
Signed-off-by: Jeff Hostetler [email protected]