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

[Bug]: TCP Accept Queue overflows on macOS #477

Closed
3 tasks done
panjf2000 opened this issue Jun 12, 2023 · 0 comments
Closed
3 tasks done

[Bug]: TCP Accept Queue overflows on macOS #477

panjf2000 opened this issue Jun 12, 2023 · 0 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@panjf2000
Copy link
Owner

panjf2000 commented Jun 12, 2023

Actions I've taken before I'm here

  • I've thoroughly read the documentations on this issue but still have no clue.
  • I've searched the Github Issues but didn't find any duplicate issues that have been resolved.
  • I've searched the internet for this issue but didn't find anything helpful.

What happened?

When I tried to increase the number of clients connecting to the gnet server to 256, it didn't accept all the new connections and hang on accept system call, visit this for more details.

The root cause would be the TCP Accept Queue overflowing, and running sysctl kern.ipc.somaxconn=1000 (default is 128) will fix this issue, although this solution seems to be a palliative rather than a cure for this issue, it could be an OS issue because it only occurred on macOS and worked well on Linux, visit this for details.

Major version of gnet

v2

Specific version of gnet

dev

Operating system

macOS

Relevant log output

https://github.com/panjf2000/gnet/actions/runs/5239348388/jobs/9459102350#step:7:983

Code snippets (optional)

No response

How to Reproduce

go test -v -race -run=TestShutdown$

Does this issue reproduce with the latest release?

It can reproduce with the latest release

@panjf2000 panjf2000 added the bug Something isn't working label Jun 12, 2023
@panjf2000 panjf2000 self-assigned this Jun 12, 2023
@panjf2000 panjf2000 added this to the v2.3.0 milestone Jun 12, 2023
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

1 participant