[ https://issues.apache.org/jira/browse/THRIFT-5172?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17079006#comment-17079006 ]
Jens Geyer edited comment on THRIFT-5172 at 4/9/20, 7:23 AM: ------------------------------------------------------------- A transport should not be able to be opened multiple times (unless Open() does really nothing), we even have a nice exception code for this. Maybe there's a check missing? In case of OOMs it could also be some IDisposable class not being disposed properly. Oh, and we accept pull requests :-) was (Author: jensg): A transport should not be able to be opened multiple times (unless Open() does really nothing), we even have a nice exception code for this. Maybe there's a check missing? In case of OOMs it could also be some IDisposable class not being disposed properly. > 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 > Priority: Major > Labels: patch > 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)