Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] .pack file locks not released when PackedGitMMAP=true

I ran into another instance of not being able to delete a cloned repository in windows.  This one appears linked to the use of "PackedGitMMAP".  Is this a known problem with trying to use virtual memory mapping?

In this test case if I "setPackedGitMMAP=false" then the repository is deleted successfully.

Mike

Test Case:
File tempDir = Files.createTempDirectory("temp_git_repo").toFile();
System.out.println("Clone Dir: " + tempDir.toString());
Git git = null;
try {
WindowCacheConfig config = new WindowCacheConfig();
config.setPackedGitMMAP(true);
WindowCache.reconfigure(config);

git = Git.cloneRepository()
.setDirectory(tempDir).call();
} finally {
if(git != null) {
git.getRepository().close();
}
FileUtils.delete(tempDir, FileUtils.RECURSIVE | FileUtils.RETRY);
}

Exception in thread "main" java.io.IOException: Could not delete file C:\Users\YOUNGS~1\AppData\Local\Temp\temp_git_repo1803971009233318937\.git\objects\pack\pack-1edb465f57d546b7c6343b02c151cb3bdd68ef87.pack
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:142)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
at org.eclipse.jgit.util.FileUtils.delete(FileUtils.java:126)
at TestGitClone.main(TestGitClone.java:28)

Back to the top