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

Jens Geyer commented on THRIFT-5172:
------------------------------------

Good catch!

> NetStd OutOfMemoryException
> ---------------------------
>
>                 Key: THRIFT-5172
>                 URL: https://issues.apache.org/jira/browse/THRIFT-5172
>             Project: Thrift
>          Issue Type: Bug
>          Components: netstd - Library
>    Affects Versions: 0.13.0
>            Reporter: Eric Bléher
>            Assignee: Eric Bléher
>            Priority: Major
>              Labels: patch
>             Fix For: 0.14.0
>
>   Original Estimate: 5m
>  Remaining Estimate: 5m
>
> When I have some network issues to connect to my Thrift server, it tries many 
> attempts to connect to it. After a while, I get a "OutOfMemory" Exception.
> I read that it may be related to too many sockets opened.
> Looking quickly at the code in .NET Standard:
> TBaseClient
> public virtual async Task OpenTransportAsync(CancellationToken 
> cancellationToken)
>  {
>  if (!_inputProtocol.Transport.IsOpen)
> { await _inputProtocol.Transport.OpenAsync(cancellationToken); }
> if (!*_inputProtocol*.Transport.IsOpen)
> { await _outputProtocol.Transport.OpenAsync(cancellationToken); }
> }
>  
>  
> This last check seems a bad copy/paste and should probably be
> if (!*_outputProtocol*.Transport.IsOpen)
> Otherwise, we indeed get the transport on the output protocol getting opened 
> many times!
>  
> I just proposed a pull request with the fix.
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to