Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jgit-dev] Exception caught while accessing pack file

Hi everyone,

I came across the error exceptionWhileReadingPack today: "ERROR: Exception caught while accessing pack file {0}, the pack file might be corrupt, {1}. Caught {2} consecutive errors while trying to read this pack." Could somebody explain in which circumstance this can happen? I saw Luca's commit message back to 2017[2], but I would like to have more detail from you.

The FileNotFoundException is typically raised in three conditions:
1. file doesn't exist
2. incompatible read vs. read/write open modes
3. filesystem locking
4. temporary lack of resources (e.g. too many open files)

1. is already managed, 2. would never happen as packs are not
overwritten while with 3. and 4. it is worth logging the exception and
retrying to read the pack again.

I suspect that our installation is in the 3rd case because we're using EFS of AWS. Any suggestion will be welcome. Thanks a lot!

---

By curiosity, I would like to fix the incorrect text in message exceptionWhileReadingPack, but I think Matthias already did it[3]. Do you think it is worth to improve the existing error message handling mechanism? I have two ideas in mind:
  1. Remove unused messages. I found 62 of them
  2. Refactor the code to avoid similar placeholder problems, like this one [4], so that the relationship between arguments and pattern can be easier to see.
I can open another thread for the discussion if needed.

Best,
Mincong

[1]: https://github.com/eclipse/jgit/blob/v5.2.1.201812262042-r/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/ObjectDirectory.java#L658-L661
[2]: https://github.com/eclipse/jgit/commit/4c558225dc991a34d59bc4fb0d4e6f1f6974f53c
[3]: https://github.com/eclipse/jgit/commit/997d785418d55dce5a1188fdb95e6d2b4ab0bde5
[4]: https://github.com/eclipse/jgit/blob/master/org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties#L550

Back to the top