Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-11529

Add libHDFS API to return last exception

    XMLWordPrintableJSON

    Details

      Description

      libHDFS uses a table to compare exceptions against and returns a corresponding error code to the application in case of an error.

      However, this table is manually populated and many times is disremembered when new exceptions are added.

      This causes libHDFS to return EINTERNAL (or Unknown Error(255)) whenever these exceptions are hit. These are some examples of exceptions that have been observed on an Error(255):

      org.apache.hadoop.ipc.StandbyException (Operation category WRITE is not supported in state standby)

      java.io.EOFException: Cannot seek after EOF

      javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Failed to find any Kerberos tgt)

      It is of course not possible to have an error code for each and every type of exception, so one suggestion of how this can be addressed is by having a call such as hdfsGetLastException() that would return the last exception that a libHDFS thread encountered. This way, an application may choose to call hdfsGetLastException() if it receives EINTERNAL.

      We can make use of the Thread Local Storage to store this information. Also, this makes sure that the current functionality is preserved.

      This is a follow up from HDFS-4997.

        Attachments

        1. HDFS-11529.006.patch
          27 kB
          Sailesh Mukil
        2. HDFS-11529.005.patch
          27 kB
          Sailesh Mukil
        3. HDFS-11529.004.patch
          84 kB
          Sailesh Mukil
        4. HDFS-11529.003.patch
          84 kB
          Sailesh Mukil
        5. HDFS-11529.002.patch
          84 kB
          Sailesh Mukil
        6. HDFS-11529.001.patch
          23 kB
          Sailesh Mukil
        7. HDFS-11529.000.patch
          22 kB
          Sailesh Mukil

          Issue Links

            Activity

              People

              • Assignee:
                sailesh Sailesh Mukil
                Reporter:
                sailesh Sailesh Mukil
              • Votes:
                0 Vote for this issue
                Watchers:
                12 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: