-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File descriptor leak in Nix master #4046
Comments
I marked this as stale due to inactivity. → More info |
I just tried this on |
Yeah, I can't reproduce this. Top-level substitution goals had a similar FD leak (8a29052). |
Still reproducible on 2.7.0 |
@veprbl how did you manage to reproduce it? Just tried on |
Just evaluated texlive from master on macOS and observed "Too many open files" on Nix 2.7.0. Trying on 2.3.16 fixed the issue. |
Oh it’s happening at eval-time? Interesting… Still can’t reproduce though. Maybe it’s a darwin-specific thing ? 🤔 |
I meant build. I remember originally I also saw a similar behaviour on Linux, it was opening some extra files (not the .lock's) in the store. |
I can experience this again, on NixOs when installing texlive with the documentation NixOS/nixpkgs#171218 I can fix it by building first my system with
|
This was causing issues for me building ( an admittingly large ) Yarn project on Debian 11 ( barebones cloud-init image with nothing other than Nix was trying to build ~6,000 derivations at once, so in fairness, it was a heavy load. I tried several of the most common ways to raise the max file limit with little success; but what finally worked was overriding the limit in the service:
|
Describe the bug
Building a derivation with Nix master leaves a number of file descriptors that aren't closed until Nix exits
Steps To Reproduce
In the background, monitor the number of FDs used by a
nix-build
process (replace bynix-store
if you're using the daemon)$ while true; do lsof -c nix-build | wc -l; done
Build a big-enough number of independant derivations:
$ nix-build many-drvs.nix
where
many-drvs.nix
is as follows:watch the output of
lsof
grow (up to ~5000 in my tests).Expected behavior
The number of opened file descriptors should be bounded (it stays under 100 for nix 2.3.7)
nix-env --version
outputAdditional context
Looking at the
lsof
output, I see a lot of.lock
(~half of the output) and.drv.bz2
(~1/4th of the output) files. I guess we forget to release these at some pointThe text was updated successfully, but these errors were encountered: