Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-8707 Implement an async pure c++ HDFS client
  3. HDFS-9749

libhdfs++: RPC engine will attempt to close an asio socket before it's been opened

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • hdfs-client
    • None

    Description

      Libhdfs++ can work itself into a state where it needs to shutdown, in this case due to config issues, and during deconstruction attempts to call shutdown() and close() on an asio::tcp::socket that was never opened. This causes asio to throw a std::system_error which ends up terminating the process. See attached stack for details.

      The fix is just to make sure the rpc_connection is actually connected before attempting to close it.

      -  next_layer_.cancel();
      -  next_layer_.close();
      +  if(connected_) {
      +    next_layer_.cancel();
      +    next_layer_.close();
      +  }
         connected_ = false;
      

      Attachments

        1. HDFS-9749.HDFS-8707.000.patch
          0.8 kB
          James Clampffer
        2. cancel_backtrace.txt
          9 kB
          James Clampffer

        Activity

          People

            James Clampffer James Clampffer
            James Clampffer James Clampffer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: