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

Lorri hangs; logs: Too many open files #82

Open
nyarly opened this issue Apr 7, 2022 · 3 comments
Open

Lorri hangs; logs: Too many open files #82

nyarly opened this issue Apr 7, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@nyarly
Copy link
Collaborator

nyarly commented Apr 7, 2022

Describe the bug

Periodically, Lorri will hang, without returning anything to requests (which e.g. blocks my shell prompt :/).

Logs report INFO Failed accepting a client connection, accept_error: Accept(Os { code: 24, kind: Uncategorized, message: "Too many open files" })

To Reproduce

Run Lorri long enough (? 48 hours)
lorri internal stream-events --kind snapshot
never returns.

Expected behavior

Lorri should have accept_errors

$ lorri info --shell-file shell.nix
lorri version: 1.5
GC roots exist, shell_gc_root: /home/judson/.cache/lorri/gc_roots/c92f309c54f033fb255ee1e6878ad199/gc_root/shell_gc_root
$ uname -a
Linux neumann 5.10.94 #1-NixOS SMP Thu Jan 27 09:54:36 UTC 2022 x86_64 GNU/Linux
@nyarly
Copy link
Collaborator Author

nyarly commented Apr 7, 2022

Part of the fix here would be to have stream-events time out after ~100ms (or wrap my call to it in a timeout...),
but I worry that the error may suggest that Lorri isn't building either.

@sersorrel
Copy link

glad I'm not the only one running into this! I thought this was caused by me running lorri internal stream-events --kind snapshot on every prompt, rather than strictly a time-based thing, but I don't actually know if that's the case.

@Profpatsch
Copy link
Collaborator

I think this was caused by us not closing the unix socket after accepting a request in the daemon.

I added code to manually close the connection after each .accept() to #146

I think you can try to reproduce by running a tight loop around stream-events --kind snapshot and checking the open fds with lsof.

@Profpatsch Profpatsch added the bug Something isn't working label Feb 20, 2025
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

No branches or pull requests

3 participants