jshen14 commented on code in PR #2883:
URL: https://github.com/apache/thrift/pull/2883#discussion_r1398256443
##########
lib/go/thrift/simple_server.go:
##########
@@ -211,6 +211,10 @@ func (p *TSimpleServer) innerAccept() (int32, error) {
select {
case <-ctx.Done():
// client exited, do nothing
+ if client != nil {
+ client.Close()
Review Comment:
Could you help clarify what is your overall performance concern?
Below is my understanding of how the simpleServer works with its
serverTransport regarding accept an incoming request. Please correct me if I
miss anything.
A client object is created by calling the underlying
serverTransport.Accept(). I think client.Close() is to signal serverTransport
that *thrift server* has finished using this client. So serverTransport could
do whatever is required on its part, either to cleanup or recycle the object
for reuse.
Without the signal from thrift server, what is expected from serverTransport
to manage *client* object created by itself? The reference to client is lost
after processing the request.
I guess thrift simple server has some assumption on how serverTransport to
manage client created by serverTransport itself. Could you help advise where I
could find the assumption?
--
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]