[ 
https://issues.apache.org/jira/browse/THRIFT-4431?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16426673#comment-16426673
 ] 

ASF GitHub Bot commented on THRIFT-4431:
----------------------------------------

lompy closed pull request #1447: THRIFT-4431 Ruby library: Finish http 
connection after flush in http client
URL: https://github.com/apache/thrift/pull/1447
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/lib/rb/lib/thrift/transport/http_client_transport.rb 
b/lib/rb/lib/thrift/transport/http_client_transport.rb
index c9c4fec8d8..38cb46675f 100644
--- a/lib/rb/lib/thrift/transport/http_client_transport.rb
+++ b/lib/rb/lib/thrift/transport/http_client_transport.rb
@@ -52,6 +52,7 @@ def flush
       @inbuf = StringIO.new data
     ensure
       @outbuf = Bytes.empty_byte_buffer
+      http.finish
     end
   end
 end


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Repetitive use of HTTPClientTransport causes "Errno::EMFILE: Failed to open 
> TCP connection"
> -------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-4431
>                 URL: https://issues.apache.org/jira/browse/THRIFT-4431
>             Project: Thrift
>          Issue Type: Bug
>          Components: Ruby - Library
>    Affects Versions: 0.10.0, 0.11.0
>            Reporter: Roman Charushin
>            Priority: Major
>             Fix For: 0.10.0, 0.11.0
>
>
> Repetitive calls to the clients initiated with the HTTPClientTransport causes 
> "Errno::EMFILE: Failed to open TCP connection" error due to too many open 
> files. And the reason is that each time client is called new http connection 
> is created at each flush and is never finished after, holding the file 
> descriptors to tcp connection files.
> In order to solve this HTTP#finish should be called in ensure block of 
> HTTPClientTransport#flush.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to