Skip to content
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

Avoid repeatedly opening /dev/null #3687

Merged
merged 1 commit into from
Aug 7, 2020
Merged

Conversation

nojb
Copy link
Collaborator

@nojb nojb commented Aug 7, 2020

Recently I started getting the following errors when building moderately-sized workspaces:

Error: open: /dev/null: Too many open files
Error: open: /tmp/dune528db4.output: Too many open files
Error: open: /tmp/dune93b269.output: Too many open files
Error: open: /tmp/duneb4d3c8.output: Too many open files
Error: open: /tmp/dune472f36.output: Too many open files
Error: open: /tmp/dune62787e.output: Too many open files
Error: open: /tmp/dune0a6e20.output: Too many open files
Error: open: /tmp/dune096c63.output: Too many open files
Error: open: /tmp/dune955bb3.output: Too many open files
Error: open: /tmp/dune2bc4c9.output: Too many open files
Error: open: /tmp/dune5fb45e.output: Too many open files
Error: /tmp/dune887f90.output: Too many open files
Error: /tmp/dune974539.output: Too many open files
Error: /tmp/duneef1640.output: Too many open files
Error: /tmp/dune3efdc3.output: Too many open files
Error: /tmp/dunede8b6d.output: Too many open files
Error: /tmp/dune73cade.output: Too many open files
Error: /tmp/duned68216.output: Too many open files
Done: 3397/3910 (jobs: 1)Fatal error: exception Sys_error("_build/.db: Too many open files")

As @emillon pointed out this seems to be related to #3677: it looks like the null device is repeatedly being opened (and not being closed?). The PR seems to fix the problem for me.

Signed-off-by: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
@emillon
Copy link
Collaborator

emillon commented Aug 7, 2020

In addition I wonder if we could just close the fd rather than having it open the null device, but that's a more complicated change.

@aalekseyev
Copy link
Collaborator

aalekseyev commented Aug 7, 2020

@emillon, closing the fd will lead to unrelated files being assigned the file descriptor 0 and the results may be very confusing. The behavior is much more predictable when the null device is used.

@rgrinberg
Copy link
Member

Looks fine. Can you check the fd limit on your machine? Perhaps we should introduce it in CI when running the test suite.

@nojb
Copy link
Collaborator Author

nojb commented Aug 7, 2020

Looks fine. Can you check the fd limit on your machine? Perhaps we should introduce it in CI when running the test suite.

1024

@rgrinberg rgrinberg added this to the 2.7 milestone Aug 7, 2020
@rgrinberg rgrinberg merged commit a8bcd56 into ocaml:master Aug 7, 2020
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.

4 participants