Copilot commented on code in PR #3727:
URL: https://github.com/apache/thrift/pull/3727#discussion_r3793372030
##########
lib/rb/lib/thrift/server/thread_pool_server.rb:
##########
@@ -47,30 +47,28 @@ def serve
loop do
@thread_q.push(:token)
Thread.new do
- begin
- loop do
- begin
- client = @server_transport.accept
- rescue => e
- next if defined?(OpenSSL::SSL::SSLError) &&
e.is_a?(OpenSSL::SSL::SSLError)
- raise
- end
- trans = @transport_factory.get_transport(client)
- prot = @protocol_factory.get_protocol(trans)
- begin
- loop do
- @processor.process(prot, prot)
- end
- rescue Thrift::TransportException, Thrift::ProtocolException
=> e
- ensure
- trans.close
+ loop do
+ begin
+ client = @server_transport.accept
+ rescue => e
+ next if defined?(OpenSSL::SSL::SSLError) &&
e.is_a?(OpenSSL::SSL::SSLError)
+ raise
+ end
+ trans = @transport_factory.get_transport(client)
+ prot = @protocol_factory.get_protocol(trans)
+ begin
+ loop do
+ @processor.process(prot, prot)
end
+ rescue Thrift::TransportException, Thrift::ProtocolException => e
Review Comment:
This rescue clause binds the exception to `e`, but `e` is never used.
Keeping an unused variable here makes the intent less clear and can trigger
unused-variable linting in some setups.
--
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]