Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.17.1
    • Fix Version/s: 0.19.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      any POSIX

    • Hadoop Flags:
      Reviewed
    • Release Note:
      Improved error reporting for libhdfs so permission problems now return EACCES.

      Description

      A comment near the top of hdfs.h says that "All APIs set errno to meaningful values." Unfortunately this is a big fat lie – bigger and fatter still now that we have permissions in HDFS. If Hadoop throws an AccessControlException, then libhdfs sets errno to EINTERNAL, even though this is not an "internal" error in any sense of the word.

      With the attached patches, allow libhdfs to derive a useful errno value when an exception is thrown. I've implemented handling for AccessControlException and a few others whose semantics seem obvious.

      Tangential question: The signatures for invokeMethod() and constructNewObjectOfClass() in hdfsJniHelper.h disagreed with their comments. Was the "exc" argument of those functions removed in the past, or never implemented? I (re)instated it in my patch.

        Attachments

        1. libhdfs-04.patch
          41 kB
          Ben Slusky
        2. libhdfs-03-combined.patch
          39 kB
          Ben Slusky
        3. libhdfs-02-meaningful-errno.patch
          34 kB
          Ben Slusky
        4. libhdfs-01-exception-handling.patch
          25 kB
          Ben Slusky

          Issue Links

            Activity

              People

              • Assignee:
                sluskyb Ben Slusky
                Reporter:
                sluskyb Ben Slusky
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: