Bug 582455 - IllegalStateException thrown during repack when one of the pack files is locked
Summary: IllegalStateException thrown during repack when one of the pack files is locked
Status: NEW
Alias: None
Product: JGit
Classification: Technology
Component: JGit (show other bugs)
Version: 5.13.1   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-09-22 05:16 EDT by Dariusz Luksza CLA
Modified: 2023-09-22 05:38 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dariusz Luksza CLA 2023-09-22 05:16:41 EDT
I found this issue while working on bug 582292 and testing a slightly different scenario where a pushed (and locked) pack file contains an amended commit.

Steps to reproduce:
1. clone repository that has at least two commits
2. amend last commit
3. force push changes
4. ensure that .keep file is present for the pushed pack files (create one if needed)
5. run jGit GC

Expected result:
GC compleats successfully.

Actual result:
Exception is thrown:

java.lang.IllegalStateException
	at org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder.generateStoredEntry(PackBitmapIndexBuilder.java:191)
	at org.eclipse.jgit.internal.storage.file.PackBitmapIndexBuilder.getCompressedBitmaps(PackBitmapIndexBuilder.java:328)
	at org.eclipse.jgit.internal.storage.file.PackBitmapIndexWriterV1.writeBitmaps(PackBitmapIndexWriterV1.java:101)
	at org.eclipse.jgit.internal.storage.file.PackBitmapIndexWriterV1.writeBody(PackBitmapIndexWriterV1.java:91)
	at org.eclipse.jgit.internal.storage.file.PackBitmapIndexWriterV1.write(PackBitmapIndexWriterV1.java:70)
	at org.eclipse.jgit.internal.storage.pack.PackWriter.writeBitmapIndex(PackWriter.java:1134)
	at org.eclipse.jgit.internal.storage.file.GC.writePack(GC.java:1232)
	at org.eclipse.jgit.internal.storage.file.GC.repack(GC.java:864)
	at org.eclipse.jgit.internal.storage.file.GC.doGc(GC.java:285)
	at org.eclipse.jgit.internal.storage.file.GC.gc(GC.java:232)
	at org.eclipse.jgit.internal.storage.file.GcKeepFilesTest.testKeepFileAllowsBitmapRemapping2(GcKeepFilesTest.java:136)
Comment 1 Dariusz Luksza CLA 2023-09-22 05:38:46 EDT
Reproduction test: https://git.eclipse.org/r/c/jgit/jgit/+/204485