Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-14032 [libhdfs++] Phase 2 improvements
  3. HDFS-10554

libhdfs++: signed to unsigned conversions are breaking things and compiler isn't issuing expected warnings

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • hdfs-client
    • None

    Description

      There's at least two places where we use -1 to indicate unset/default values that end up getting cast into unsigned integers. The compiler should be smart enough to figure this out and issue a warning but it's not; we need to find out what's going on there. We also need to fix the places where this sort of thing has found its way into the code:

      In URI

            // -1 if the port is undefined.
            optional<uint16_t> get_port() const
            { return port; }
      

      In Options (gets cast to uint64_t somewhere)

          /**
           * Maximum number of retries for RPC operations
           **/
          int max_rpc_retries;
          static const int kNoRetry = -1;
      

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated: