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

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

GitHub user justonia opened a pull request:

    https://github.com/apache/thrift/pull/701

    THRIFT-3405

    Implementation for THttpClient as referenced by:
    
    https://issues.apache.org/jira/browse/THRIFT-3405
    
    Some lines within the RemainingBytes() method were changed as a result of 
running go fmt and are unrelated to the issue above.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/justonia/thrift THRIFT-3405

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/thrift/pull/701.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #701
    
----
commit 1f64fe85877019c0ef89384b008dfc0bd770593b
Author: Justin Larrabee <[email protected]>
Date:   2015-11-17T18:20:35Z

    THttpClient now utilizes a package level shared HTTP client and optionally 
allows users of the library to specify one.

----


> Go THttpClient misuses http.Client objects
> ------------------------------------------
>
>                 Key: THRIFT-3405
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3405
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Go - Library
>    Affects Versions: 0.9.3
>         Environment: Any
>            Reporter: Justin Larrabee
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> THttpClient:Flush creates an http.Client object every time it is called. From 
> the Go docs regarding the use of these client objects:
> "Clients and Transports are safe for concurrent use by multiple goroutines 
> and for efficiency should only be created once and re-used."
> I suggest that the client used by the THttpTransport default to using either 
> the http.DefaultClient or a package scoped default client. The transport 
> should also accept a http.Client as an optional parameter so users of the 
> library are free to control this behavior.
> With the current implementation I have run into issues when spinning up ~1000 
> separate instances of the THttpClient for a load test application I have 
> written. Switching to using a single shared http client resolved all 
> connection issues I had.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to