Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] question on pack files

I'm not sure it happened inside IndexPack.renameAndOpenPack()
because I don't have stacktraces yet.

We sync repository periodically. From some point in time during
every attemp to do the fetch we got OutOfMemory error which is
known problem. Also it seems that during each fetch new .pack
file appears in the objects/pack. They eventually fills up the
whole disk. I wonder is it possible to get OOM error during
renameAndOpenPack() ant try to fetch same pack again and
again (but with different name)?

On Thu, Jan 13, 2011 at 8:59 PM, Shawn Pearce <spearce@xxxxxxxxxxx> wrote:
> On Thu, Jan 13, 2011 at 06:34, Dmitry Neverov <dmitry.neverov@xxxxxxxxx> wrote:
>> is it possible that .pack file was saved in objects/pack/ dir but
>> jgit is stay unaware that it has objects from this pack and tries to
>> download pack again?
>
> This shouldn't occur unless the .idx file is missing.  JGit needs the
> .idx to use the .pack, and will skip a .pack that doesn't have a
> sibling .idx file.
>
>> I read the code of IndexPack.renameAndOpenPack() and it delete
>> final .idx and .pack files only in the case of IOException. What
>> if other error occurs during the call to repo.openPack(finalPack, finalIdx)?
>
> If another error occurs here its likely a mismatch between the
> finalPack and finalIdx; e.g. their object counts disagree or the
> trailing SHA-1 checksum doesn't match.  This case is very unlikely for
> IndexPack as it just created the two files.  The other failure might
> be you cannot open the files because the JVM process is out of file
> descriptors.  Again there isn't much we can do here, and it doesn't
> imply the files are invalid, so we shouldn't delete them.
>
> What are you seeing occur?  I can't come up with a way for JGit to
> fail to identify a pack that went through Repository.openPack() as
> called by IndexPack.
>
> --
> Shawn.
>


Back to the top