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.
There is a critical issue in recently introduced AcceptLimiter. Here is what happens:
@nayato