Too many open files in org.eclipse.jgit.internal.storage.file.PackDirectory

48 views
Skip to first unread message

Nicholas Brealey

unread,
Jan 22, 2026, 4:00:38 AM (13 days ago) Jan 22
to Repo and Gerrit Discussion
Hi All

I am using Gerrit 3.13.1 and I am seeing messages like:

[2026-01-22T06:37:45.775+01:00] [pool-79-thread-7] ERROR org.eclipse.jgit.internal.storage.file.PackDirectory : Failed to access pack file /var/gerrit/git/operafea-source.git/objects/pack
/pack-8152c5d2927b49b65b8233160a7dadeae358fa60.pack, caught 1 consecutive errors while trying to access this pack.
java.io.FileNotFoundException: /var/gerrit/git/operafea-source.git/objects/pack/pack-8152c5d2927b49b65b8233160a7dadeae358fa60.pack (Too many open files)
        at java.base/java.io.RandomAccessFile.open0(Native Method)
        at java.base/java.io.RandomAccessFile.open(RandomAccessFile.java:356)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:273)
        at java.base/java.io.RandomAccessFile.<init>(RandomAccessFile.java:223)
        at org.eclipse.jgit.internal.storage.file.Pack.doOpen(Pack.java:819)
        at org.eclipse.jgit.internal.storage.file.Pack.beginWindowCache(Pack.java:794)
        at org.eclipse.jgit.internal.storage.file.WindowCache.load(WindowCache.java:564)
        at org.eclipse.jgit.internal.storage.file.WindowCache.getOrLoad(WindowCache.java:656)
        at org.eclipse.jgit.internal.storage.file.WindowCache.get(WindowCache.java:389)
        at org.eclipse.jgit.internal.storage.file.WindowCursor.pin(WindowCursor.java:390)
        at org.eclipse.jgit.internal.storage.file.WindowCursor.copy(WindowCursor.java:290)
        at org.eclipse.jgit.internal.storage.file.Pack.readFully(Pack.java:764)
        at org.eclipse.jgit.internal.storage.file.Pack.load(Pack.java:965)
        at org.eclipse.jgit.internal.storage.file.Pack.get(Pack.java:404)
        at org.eclipse.jgit.internal.storage.file.PackDirectory.open(PackDirectory.java:225)
        at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedObject(ObjectDirectory.java:422)
        at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openPackedFromSelfOrAlternate(ObjectDirectory.java:385)
        at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObjectWithoutRestoring(ObjectDirectory.java:375)
        at org.eclipse.jgit.internal.storage.file.ObjectDirectory.openObject(ObjectDirectory.java:359)
        at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:146)
        at org.eclipse.jgit.lib.ObjectReader.open(ObjectReader.java:216)
        at org.eclipse.jgit.internal.storage.pack.PackWriter.buffer(PackWriter.java:1998)
        at org.eclipse.jgit.internal.storage.pack.DeltaWindow.buffer(DeltaWindow.java:377)
        at org.eclipse.jgit.internal.storage.pack.DeltaWindow.index(DeltaWindow.java:357)
        at org.eclipse.jgit.internal.storage.pack.DeltaWindow.delta(DeltaWindow.java:252)
        at org.eclipse.jgit.internal.storage.pack.DeltaWindow.searchInWindow(DeltaWindow.java:188)
        at org.eclipse.jgit.internal.storage.pack.DeltaWindow.search(DeltaWindow.java:144)
        at org.eclipse.jgit.internal.storage.pack.DeltaTask.runWindow(DeltaTask.java:295)
        at org.eclipse.jgit.internal.storage.pack.DeltaTask.call(DeltaTask.java:270)
        at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1595)

This may be occurring during gc, the config file contains:
[gc]
        startTime = 06:00
        interval = 1d
        jitter = 5m

I updated /etc/default/gerritcodereview to include:
GERRIT_FDS=4096
but I have left core.packedGitOpenFiles as the default.

I don't know if the error is coming from the OS limit (GERRIT_FDS) or the Gerrit limit (core.packedGitOpenFiles).

Can anyone help?

I saw a similar issue reported in https://groups.google.com/g/repo-discuss/c/1yZ9hYiKiBo but no solution there.

Regards
Nick



Z

unread,
Jan 22, 2026, 4:05:07 AM (13 days ago) Jan 22
to Repo and Gerrit Discussion
Increase the number of  core.packedGitOpenFiles  in gerrit.config and restart gerrit

Nicholas Brealey 在 2026年1月22日 星期四下午5:00:38 [UTC+8] 的信中寫道:

Nicholas Brealey

unread,
Jan 22, 2026, 6:03:47 AM (13 days ago) Jan 22
to Repo and Gerrit Discussion
Thank you for the advise. I have increased core.packedGitOpenFiles and restarted gerrit.

I will watch the logs for a few days and report back.

Nicholas Brealey

unread,
Feb 2, 2026, 5:42:53 AM (2 days ago) Feb 2
to Repo and Gerrit Discussion
Thank you.

I increased core.packedGitOpenFile to 512 which seemed to reduce the number of errors and then increased it to 1024 which seems to have eliminated the error completely.
I have also updated to 3.13.2.

Reply all
Reply to author
Forward
0 new messages