Skip to content
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

Prefetch all files on clone #56

Merged
merged 2 commits into from
Aug 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,10 @@ private void ExpandOneTempPack(bool copyPackBackToPackDirectory)
string[] packFiles = Directory.GetFiles(this.TempPackRoot, "pack-*.pack");
Assert.Greater(packFiles.Length, 0);

// Pick the first one found
string packFile = packFiles[0];
List<FileInfo> fileInfos = packFiles.Select(file => new FileInfo(file))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was able to repro the functional test hang, and it is related to unpacking the prefetch pack. To fix the problem long-term, we will want to make these tests use the sparse mode, which avoids the prefetch. Temporarily, we can select the smallest pack to turn into loose objects.

.ToList();
fileInfos.Sort((f1, f2) => (int)(f2.Length - f1.Length));
string packFile = fileInfos[0].FullName;

// Send the contents of the packfile to unpack-objects to example the loose objects
// Note this won't work if the object exists in a pack file which is why we had to move them
Expand Down
Loading