libgit2 / libgit2/libgit2sharp
throw LibGit2SharpException or repo.Head.TIp==null while parallel
Open
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3.5k
- Forks
- 925
- PR merge metrics
- No merged PRs in 30d
Description
Updated. Code simplified
// use LibGit2Sharp.0.16.0.0 from nuget
// https://github.com/torvalds/linux
var gitpath = @"path/to/linux/source";
var times = 10;
for (int i = 0; i < times; i++)
{
Task.Run(() =>
{
using (var repo = new Repository(gitpath))
{
// sometimes throw LibGit2SharpException here
// An exception of type 'LibGit2Sharp.LibGit2SharpException' occurred in LibGit2Sharp.dll but was not handled in user code
// Additional information: An error was raised by libgit2. Category = Os (Error).
// Failed to mmap. No data written: Not enough storage is available to process this command.
foreach (var commit in repo.Commits)
{
}
}
});
}
while (true)
{
using (var repo = new Repository(gitpath))
{
// sometimes repo.Head.Tip == null
repo.Head.Tip.ToString();
}
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the parallel reproduction using Repository(gitpath), repo.Commits, and repo.Head.Tip, then run it against the Linux repository with LibGit2Sharp 0.16.0.0. Investigate whether concurrent repository construction or access causes the mmap failure and null tip; done means the reported parallel operations no longer produce either symptom, with a regression test if the project has a suitable test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, git
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100