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

[EMFILE] How to handle too many opened files error? #108

Open
abique opened this issue Nov 23, 2021 · 4 comments
Open

[EMFILE] How to handle too many opened files error? #108

abique opened this issue Nov 23, 2021 · 4 comments

Comments

@abique
Copy link
Contributor

abique commented Nov 23, 2021

Hi,

Currently Ableton Link does not provide a good way to check if link could successfully initialize and is ready to do its job.
I've found that it is even worse, if it can't properly initialize due to "too many opened files" error then the destruction of the link object may never return and wait forever on joining threads doing nothing.

Maybe I've missed something?

Regards,
Alex

@abique abique changed the title How to handle too many opened files error? [EMFILE] How to handle too many opened files error? Nov 23, 2021
@cdi-ableton
Copy link
Contributor

You haven't missed anything. And this is indeed tricky. Can you confirm that the issue persists on the latest commit on 'master'? We re-worked the thread and lifetime management and would be interested to know if joining the threads blocks after these changes.

@abique
Copy link
Contributor Author

abique commented Nov 24, 2021

I've tested it with the latest commit yesterday and I even tried with the latest version of asio (1.21 maybe?). The issue still remains.

@abique
Copy link
Contributor Author

abique commented Nov 24, 2021

To reproduce it:

  • limit the number of files to N
  • open N files (minus what's already opened, stdin, stdout, stderr, ...) see if ableton link works
  • open N-1 files in another process, and check again
  • open N-2 files, ...

I don't know how many files ableton link needs, at least 2 I suppose, one for epoll and one for the socket. Good to try all the failure scenarios.

Good luck!

@fgo-ableton
Copy link
Collaborator

Hey,
I tried opening files until I hit the limit from LinkHut and other apps. Of cause LinkHut will not be able to connect when it can't open a socket anymore, but I never got it into a state where it could not join the worker thread when destructing Link.

If you have a way to reproduce this, could you maybe try to replace the run() in

with a run_one() and check if that changes the behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants