Skip to content

Increase the open file soft limit to the hard limit#15205

Merged
edolstra merged 1 commit intomasterfrom
bump-file-limit-upstream
Feb 11, 2026
Merged

Increase the open file soft limit to the hard limit#15205
edolstra merged 1 commit intomasterfrom
bump-file-limit-upstream

Conversation

@edolstra
Copy link
Member

Motivation

On some platforms (macOS), the default soft limit is very low, but the hard limit is high. So let's just raise it the maximum permitted.

macOS users reported that the tarball cache was failing with errors like

error: creating git packfile indexer: failed to create temporary file '/Users/anon/.cache/nix/tarball-cache-v2/objects/pack/pack_git2_56d617039ac17c2b': Too many open files

It's possible this started happening because of the multithreaded tarball cache import opening more files in parallel. Hopefully this fixes it.

Context


Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

On some platforms (macOS), the default soft limit is very low, but the
hard limit is high. So let's just raise it the maximum permitted.
@edolstra
Copy link
Member Author

This may be a Determinate Nix specific issue because it's keeping the tarball cache open in getTarballCache().

Regardless, it probably doesn't hurt to bump the open file limit since there have been various bug reports about this in the past (#8684, #10158). (Though this PR only helps if the hard limit is higher than the soft limit.)

Copy link
Contributor

@xokdvium xokdvium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good enough for now, but the libgit2 issue should probably get addressed at the root cause. It doesn't seem to close any file descriptors for .pack or .idx files from me strace-ing things.

@edolstra edolstra enabled auto-merge February 11, 2026 21:15
@edolstra edolstra added this pull request to the merge queue Feb 11, 2026
Merged via the queue into master with commit d4a0024 Feb 11, 2026
18 checks passed
@edolstra edolstra deleted the bump-file-limit-upstream branch February 11, 2026 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants