Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5172

NetStd TBaseClient open output transport multiple times

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.13.0
    • Fix Version/s: 0.14.0
    • Component/s: netstd - Library
    • Labels:
    • Patch Info:
      Patch Available
    • Flags:
      Patch, Important

      Description

      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. EDIT: unrelated to this issue.

      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.

       

        Attachments

          Activity

            People

            • Assignee:
              EricBl Eric Bléher
              Reporter:
              EricBl Eric Bléher
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 5m
                5m
                Remaining:
                Remaining Estimate - 5m
                5m
                Logged:
                Time Spent - Not Specified
                Not Specified