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

Low listen() backlog #1499

Closed
tihmstar opened this issue Mar 26, 2024 · 0 comments · Fixed by #1501
Closed

Low listen() backlog #1499

tihmstar opened this issue Mar 26, 2024 · 0 comments · Fixed by #1501

Comments

@tihmstar
Copy link
Contributor

Expected Result
Spawning multiple darling shell instances simultaneously from different processes (eg. different ttys) should work.

Actual Result
Some instances show error that connection to shellspawn.sock failed

Steps To Reproduce

  1. Spawn many darling shell simultaneously

The issue is that in the listen() call here: https://github.com/darlinghq/darling/blob/master/src/shellspawn/shellspawn.c#L88
The backlog is set to 1.
Instead the backlog should be set to a very large value.
I fixed it locally by setting it to 4096, but it may be worth setting it to an even higher number.

No need to worry about too high number, as linux automatically silently caps it.
Here is an except from the manpages

       If the backlog argument is greater than the value in
       /proc/sys/net/core/somaxconn, then it is silently capped to that
       value.  Since Linux 5.4, the default in this file is 4096; in
       earlier kernels, the default value is 128.  Before Linux 2.4.25,
       this limit was a hard coded value, SOMAXCONN, with the value 128.
CuriousTommy added a commit that referenced this issue Mar 28, 2024
Increase the backlog value from 1 to 16384. Fixes #1499

Co-Authored-By: tihmstar <tihmstar@gmail.com>
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 a pull request may close this issue.

1 participant