fishy commented on a change in pull request #2497:
URL: https://github.com/apache/thrift/pull/2497#discussion_r779829053
##########
File path: lib/go/thrift/simple_server.go
##########
@@ -193,7 +195,13 @@ func (p *TSimpleServer) innerAccept() (int32, error) {
}
if client != nil {
p.wg.Add(1)
+ p.clients[client] = struct{}{}
go func() {
+ defer func() {
+ p.mu.Lock()
+ defer p.mu.Unlock()
+ delete(p.clients, client)
Review comment:
with either a ticker or every N deletes, we should make the ticker
time/N configurable.
so if we choose ticker approach, and some service know that it could handle
a lot of connections, they can choose to set a shorter ticker time to cleanup
more often.
I think a shorter ticker time might work better as with a shorter ticker
time usually also comes with smaller map to copy over, so the whole
"stop-the-world-gc-ish" thing can be quicker and less noticeable.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]