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

FD leak in Eio_luv.run #419

Closed
talex5 opened this issue Jan 27, 2023 · 0 comments · Fixed by #421
Closed

FD leak in Eio_luv.run #419

talex5 opened this issue Jan 27, 2023 · 0 comments · Fixed by #421
Labels
bug Something isn't working

Comments

@talex5
Copy link
Collaborator

talex5 commented Jan 27, 2023

This program fails with EMFILE after a bit:

let () =
  while true do
    Eio_luv.run ignore
  done

I suspect it's not closing async and the loop in the right order.

@talex5 talex5 added the bug Something isn't working label Jan 27, 2023
talex5 added a commit to talex5/eio that referenced this issue Jan 27, 2023
Previously, we asked to close the `async` notifier after the loop had
stopped. Presumably because the loop wasn't running, this close
operation never ran, which leaked some FDs. Also, the `Loop.close` it
was supposed to call after closing itself never got called either.

Once that was fixed, `Loop.close` reported further resource leaks in the
Poll and Process modules, which this commit also fixes.

Fixes ocaml-multicore#419.
talex5 added a commit to talex5/eio that referenced this issue Jan 30, 2023
Previously, we asked to close the `async` notifier after the loop had
stopped. Presumably because the loop wasn't running, this close
operation never ran, which leaked some FDs. Also, the `Loop.close` it
was supposed to call after closing itself never got called either.

Once that was fixed, `Loop.close` reported further resource leaks in
`Poll`, `Process`, `sleep_ms` and `domain_mgr`, which this commit also
fixes.

Fixes ocaml-multicore#419.

Co-authored-by: Patrick Ferris <patrick@sirref.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant