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

TConnection not resetBuffer in outputTransport when socket write failed

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 0.13.0
    • None
    • C++ - Library
    • None

    Description

      I am not sure if it is a bug. And may affect versions long ago.

      • My Server is cpp.TNonblockingServer
      • Return 100M data in one rpc
      1. client send rpc to server
      2. server recevie by thread0, then write 100M data to socket
      3. client read timeout, then retry and use another socket
      4. server recevie by thread1, then write new 100M data to new socket
      5.  ...
      6. every thread has 100M data, then server is killed by OOM

       

      void TNonblockingServer::TConnection::checkIdleBufferMemLimit(size_t readLimit, size_t writeLimit) {
        if (readLimit > 0 && readBufferSize_ > readLimit) {
          free(readBuffer_);
          readBuffer_ = nullptr;
          readBufferSize_ = 0;
        }  if (writeLimit > 0 && largestWriteBufferSize_ > writeLimit) { // this line
          // just start over
          outputTransport_->resetBuffer(static_cast<uint32_t>(server_->getWriteBufferDefaultSize()));
          largestWriteBufferSize_ = 0;
        }
      }

      Attachments

        1. oom-activity.png
          181 kB
          Qu Pingzhe

        Activity

          People

            Unassigned Unassigned
            qupingzhe Qu Pingzhe
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: