Eric Bléher created THRIFT-5172: ----------------------------------- Summary: 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
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 wanted to push a branch with the fix, but I don't have permission on the Thrift repo. remote: Permission to apache/thrift.git denied to xxxx. fatal: unable to access 'https://github.com/apache/thrift/': The requested URL returned error: 403 -- This message was sent by Atlassian Jira (v8.3.4#803005)