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

False positive timeout or wrongly blocking recv in the THttpTransport client

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 0.10.0
    • Fix Version/s: None
    • Component/s: C++ - Library
    • Environment:

      Linux 64 bit - CentOS Linux release 7.3.1611

    • Patch Info:
      Patch Available
    • Flags:
      Patch, Important

      Description

      Before we get more data by doing refill in the THttpTransport::readMoreData(), we need to check whether we have already the entire content in the buffer (fetched in the last ::recv in TSocket::read() while processing the previous chunk). Doing refill without this check may lead to calling ::recv even though all chunks (the entire content) are already in the buffer. The effect of this is that the call fails either with a false positive timeout or blocks in recv if no timeout is configured.

      Attached is the suggested patch and tcpdump pcap (you can clearly see there that we wait for more data although we have already ACKed the last piece of byte - tcp.stream eq 26).

        Attachments

        1. httpTransportClientPatch.patch
          0.8 kB
          Iliya Gurov

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              igurov Iliya Gurov
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: