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

Accept Limiter issue #159

Open
krish-gh opened this issue Apr 18, 2020 · 0 comments
Open

Accept Limiter issue #159

krish-gh opened this issue Apr 18, 2020 · 0 comments

Comments

@krish-gh
Copy link
Contributor

krish-gh commented Apr 18, 2020

There is a critical issue in recently introduced AcceptLimiter. Here is what happens:

  • When concurrent connection attempts crosses the threshold (not yet released by other ongoing connections), it skips context.Read in Channel.Read method. For the current connection, it goes through the pipeline. But this causes the parent event loop stops accepting any further connections "forever" even after claim is released and available. Basically anytime limit is crossed, PG parent event loop goes to limbo and only way to recover is to restart service.
  • It's easy to reproduce in local debugging too by setting the MaxConcurrentAccepts = 1 in BootStrapper and try to connect 2 devices simultaneously. You will see the first connection succeeds, then disconnect and try to connect again which "never" happen since single threaded parent loop did not read the context earlier.
  • I believe there is no way you can prevent the TCP connect attempt in netty. The max that can be done is Close from the child handler AcceptLimiterTlsReleaseHandler by checking whether it is able to claim. But that would be more of a reactive way than proactive defeating the purpose.

@nayato

@krish-gh krish-gh changed the title Accept Limiter is flawed Accept Limiter issue Apr 18, 2020
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

No branches or pull requests

1 participant