Uploaded image for project: 'Apache IoTDB'
  1. Apache IoTDB
  2. IOTDB-1678

client-cpp session bug: can cause connection leak.

    XMLWordPrintableJSON

Details

    Description

      in file Session.h and Session.cpp

      ========================================

      class Session

      {    ...    std::shared_ptr <apache::thrift::transport::TSocket> transport; }

       

      void Session::open(bool enableRPCCompression, int connectionTimeoutInMs)

      {    ...    shared_ptr <TTransport> transport(new TFramedTransport(socket));  //here, wrongly create 1 new variable transport, and no code will call this local variable transport->close() to release connection }

       

      void Session::close() {
         if (transport != NULL)

      {  //here, use Session.transport       transport->close();    }

      }

       

      Attachments

        Activity

          People

            jamber001 Bo Zhang
            jamber001 Bo Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: