Skip to content

delay new connection in case of exausted files#1004

Closed
domenkozar wants to merge 1 commit intoyesodweb:masterfrom
cachix:fix-emfile-busy-loop
Closed

delay new connection in case of exausted files#1004
domenkozar wants to merge 1 commit intoyesodweb:masterfrom
cachix:fix-emfile-busy-loop

Conversation

@domenkozar
Copy link
Copy Markdown
Contributor

Fixes #1003

@domenkozar domenkozar force-pushed the fix-emfile-busy-loop branch 2 times, most recently from 41c96dc to 05fc4f1 Compare September 15, 2024 10:06
@domenkozar
Copy link
Copy Markdown
Contributor Author

cc @kazu-yamamoto

@kazu-yamamoto kazu-yamamoto self-requested a review September 18, 2024 22:20
@kazu-yamamoto
Copy link
Copy Markdown
Contributor

In the case of eMFILE, we should wait for the number of connections decreases using counter (TVar Int) as @nh2 suggested. (It seems to me that the delay approach is ad-hoc.)

@nh2 I don't understand what we should do for the case of eCONNABORTED yet. In my understanding, accept throws eCONNABORTED when the creation of a new connection fails. We can use the listen socket safely again. Is the current code good enough for the case of eCONNABORTED?

@domenkozar
Copy link
Copy Markdown
Contributor Author

Note that number of open files might not just depend on warp, but it can also be due to other things running in the same space.

Either way, I'm happy as long as it doesn't busy-loop or just crash.

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.

busy loop on too many open files

2 participants