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

THttpClient sends previous message or partial message after http error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 0.13.0
    • 0.14.0
    • Go - Library
    • None

    Description

      We noticed that there's an "out of order sequence response" error immediately after an http error or premature context closure. We are seeing a lot of these in production.

      It seems like THttpClient does not reset it's internal buffer when http client returns an error, leaving the whole or partially read message in the buffer. On next call THttpClient sends the remains of previous message followed by current message, causing the server to execute it  and return the previous seqId hence the  "out of order sequence response" errors.

      Here's a small test of THttpClient that demonstrates this issue: https://github.com/wheely/thrift/blob/c130f2452428540a4eefc4c422c8abc329ec837d/lib/go/thrift/http_client_test.go#L101-L147 .

      First flush fails due to closed context, second flush succeeds but writes both messages to the server. In current thrift version this test fails with:

      http_client_test.go:144: Received unexpected data: write 1write 2

       

      Please let me know if you need a better example.

       

      Attachments

        Activity

          People

            Unassigned Unassigned
            ilyawheely Ilya Morozov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 3h 10m
                3h 10m