Skip to main content



      Home
Home » Eclipse Projects » EGit / JGit » Pack file handle remains open after using a shared repository
Pack file handle remains open after using a shared repository [message #1394481] Sat, 05 July 2014 06:53 Go to next message
Eclipse UserFriend
Hi,

With JGit, when operates against a shared repository (cloned from some other repository with "--shared" option), the opened pack file will remain open even if the shared repository is closed. To reproduce:

1. clone a shared repository from command line:
git clone --bare --shared /path/to/normal_repo /path/to/shared_repo
2. write a simple program containing below statements:

Repository repo = new FileRepository(new File("/path/to/shared_repo"));
// call log command to have JGit load the pack file
LogCommand log = new Git(repo1).log();
log.addRange(repo.resolve("master~100"), repo.resolve("master")).call();
repo.close();
// sleep a while so that we can check opened file handles with some profiling tool
Thread.sleep(3600*1000L);

3. Now examine opened file handles of the program using some profile tools, and it turns out that JGit opened a RandomAccessFile handle to pack file under /path/to/normal_repo, which is correct. However this handle will not be closed after repo.close(). If we operate against the normal repository, the pack file handle will be closed right away after calling repo.close(). Ideally JGit should remain a reference count to the opened pack file handle, and then get it closed when no any repository is referencing it.

I am not sure if this is a bug or there is something I am not aware of. Please advice.

Thanks!
Re: Pack file handle remains open after using a shared repository [message #1397513 is a reply to message #1394481] Wed, 09 July 2014 16:59 Go to previous messageGo to next message
Eclipse UserFriend
Please file a bug with your observation
Re: Pack file handle remains open after using a shared repository [message #1397670 is a reply to message #1397513] Wed, 09 July 2014 22:35 Go to previous message
Eclipse UserFriend
Thanks. A bug has been filed for this as below:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=439305
Previous Topic:Check Git connection
Next Topic:Doubt about git repositories inside Eclipse project folders
Goto Forum:
  


Current Time: Wed Jul 23 09:26:36 EDT 2025

Powered by FUDForum. Page generated in 0.25910 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top