Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » 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 10:53 Go to next message
Robin Shen is currently offline Robin ShenFriend
Messages: 2
Registered: July 2014
Junior Member
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 20:59 Go to previous messageGo to next message
Matthias Sohn is currently offline Matthias SohnFriend
Messages: 612
Registered: July 2009
Senior Member
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] Thu, 10 July 2014 02:35 Go to previous message
Robin Shen is currently offline Robin ShenFriend
Messages: 2
Registered: July 2014
Junior Member
Thanks. A bug has been filed for this as below:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=439305
Previous Topic:Unable to install Egit for Eclipse
Next Topic:Doubt about git repositories inside Eclipse project folders
Goto Forum:
  


Current Time: Sat Dec 20 10:30:06 GMT 2014

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

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