Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-10816

KeyShell returns -1 on error to the shell, should be 1

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.0.0-alpha1
    • 2.6.0
    • security
    • None

    Description

      I've seen this in several places now - commands returning -1 on failure to the shell. It's a bug. Someone confused their posix style returns (0 on success, < 0 on failure) with program returns, which are an unsigned character. Thus, a return of -1 actually becomes 255 to the shell.

      $ hadoop key create happykey2 --provider kms://http@localhost:16000/kms --attr "a=a" --attr "a=b"
      
      Each attribute must correspond to only one value:
      atttribute "a" was repeated
      
      ...
      
      $ echo $?
      255
      

      A return value of 1 instead of -1 does the right thing.

      Attachments

        1. HADOOP-10816.002.patch
          7 kB
          Mike Yoder
        2. HADOOP-10816.001.patch
          7 kB
          Mike Yoder

        Activity

          People

            yoderme Mike Yoder
            yoderme Mike Yoder
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: