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

Timeouts can leave client in unrecoverable state

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 0.9.1
    • None
    • Go - Library
    • None

    Description

      If you set the timeout on a TSocket and experience a timeout the client will stop reading the struct and return the error as expected.

      But if you use the TSocket again after the remote system has sent the timedout data and the client has received it the client will be unusable because it ends up in a state with incorrect sequence-ids and unexpected data in its buffer.

      This means that the TSocket should be closed if there is any network level error when reading/writing.

      This can also be fixed by making more attempts to read/write when the error is a net.Error and err.Temporary() is true. Could also do something where the client is persistently reading from the socket and discards out of order messages or handle out of order sequences.

      Test case to show the failures attached

      Attachments

        1. timeout.thrift
          0.0 kB
          Chris Bannister
        2. testcase.go
          1 kB
          Chris Bannister

        Activity

          People

            Unassigned Unassigned
            Zariel Chris Bannister
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: