Hadoop Common
  1. Hadoop Common
  2. HADOOP-3963

libhdfs should never exit on its own but rather return errors to the calling application

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.19.0
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Incompatible change, Reviewed
    • Release Note:
      Hide
      Modified libhdfs to return NULL or error code when unrecoverable error occurs rather than exiting itself.
      Show
      Modified libhdfs to return NULL or error code when unrecoverable error occurs rather than exiting itself.

      Description

      A a library, libhdfs would be better to return errors rather than directly exiting. This way the calling application can determine what to do on error. And it is more unix library like to handle errors this way.

      Some applications like fuse-dfs need to handle the exit themselves after emitting an appropriate error message to its log.

      1. patch1.txt
        7 kB
        Pete Wyckoff
      2. patch0.txt
        11 kB
        Pete Wyckoff

        Issue Links

          Activity

          Pete Wyckoff created issue -
          Pete Wyckoff made changes -
          Field Original Value New Value
          Attachment patch0.txt [ 12388337 ]
          Pete Wyckoff made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Pete Wyckoff made changes -
          Assignee Pete Wyckoff [ wyckoff ]
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12388337/patch0.txt
          against trunk revision 686893.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no tests are needed for this patch.

          -1 javadoc. The javadoc tool appears to have generated 1 warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 release audit. The applied patch does not increase the total number of release audit warnings.

          -1 core tests. The patch failed core unit tests.

          -1 contrib tests. The patch failed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/artifact/trunk/build/test/checkstyle-errors.html
          Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12388337/patch0.txt against trunk revision 686893. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. -1 javadoc. The javadoc tool appears to have generated 1 warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. -1 core tests. The patch failed core unit tests. -1 contrib tests. The patch failed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3067/console This message is automatically generated.
          Hide
          Owen O'Malley added a comment -

          This looks fine, except for where you commented out the exits. We always prefer to actually remove the code and count on version control to put it back if needed.

          Show
          Owen O'Malley added a comment - This looks fine, except for where you commented out the exits. We always prefer to actually remove the code and count on version control to put it back if needed.
          Owen O'Malley made changes -
          Status Patch Available [ 10002 ] Open [ 1 ]
          Pete Wyckoff made changes -
          Link This issue is blocked by HADOOP-3968 [ HADOOP-3968 ]
          Hide
          Pete Wyckoff added a comment -

          addressed owen's comments.

          Show
          Pete Wyckoff added a comment - addressed owen's comments.
          Pete Wyckoff made changes -
          Attachment patch1.txt [ 12389619 ]
          Pete Wyckoff made changes -
          Status Open [ 1 ] Patch Available [ 10002 ]
          Pete Wyckoff made changes -
          Fix Version/s 0.19.0 [ 12313211 ]
          Hide
          Hadoop QA added a comment -

          -1 overall. Here are the results of testing the latest attachment
          http://issues.apache.org/jira/secure/attachment/12389619/patch1.txt
          against trunk revision 692700.

          +1 @author. The patch does not contain any @author tags.

          -1 tests included. The patch doesn't appear to include any new or modified tests.
          Please justify why no tests are needed for this patch.

          +1 javadoc. The javadoc tool did not generate any warning messages.

          +1 javac. The applied patch does not increase the total number of javac compiler warnings.

          +1 findbugs. The patch does not introduce any new Findbugs warnings.

          +1 core tests. The patch passed core unit tests.

          +1 contrib tests. The patch passed contrib unit tests.

          Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/testReport/
          Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
          Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/artifact/trunk/build/test/checkstyle-errors.html
          Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/console

          This message is automatically generated.

          Show
          Hadoop QA added a comment - -1 overall. Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12389619/patch1.txt against trunk revision 692700. +1 @author. The patch does not contain any @author tags. -1 tests included. The patch doesn't appear to include any new or modified tests. Please justify why no tests are needed for this patch. +1 javadoc. The javadoc tool did not generate any warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 findbugs. The patch does not introduce any new Findbugs warnings. +1 core tests. The patch passed core unit tests. +1 contrib tests. The patch passed contrib unit tests. Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/testReport/ Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/artifact/trunk/build/test/checkstyle-errors.html Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/3199/console This message is automatically generated.
          Hide
          Pete Wyckoff added a comment -

          no new tests because this is only when something is drastically wrong and in the current libhdfs environment that is almost impossible to test.

          The fact that the tests pass show that under normal conditions, everything is correct.

          We could make libhdfs testing more robust be changing hdfs_test.c to testHdfs.java, but that's a bigger project.

          Can someone please commit this as there 3 other pending libhdfs patches in the pipeline.

          thanks, pete

          Show
          Pete Wyckoff added a comment - no new tests because this is only when something is drastically wrong and in the current libhdfs environment that is almost impossible to test. The fact that the tests pass show that under normal conditions, everything is correct. We could make libhdfs testing more robust be changing hdfs_test.c to testHdfs.java, but that's a bigger project. Can someone please commit this as there 3 other pending libhdfs patches in the pipeline. thanks, pete
          Hide
          dhruba borthakur added a comment -

          I just committed this. Thanks Pete!

          Show
          dhruba borthakur added a comment - I just committed this. Thanks Pete!
          dhruba borthakur made changes -
          Hadoop Flags [Incompatible change] [Incompatible change, Reviewed]
          Status Patch Available [ 10002 ] Resolved [ 5 ]
          Resolution Fixed [ 1 ]
          Hide
          Hudson added a comment -
          Show
          Hudson added a comment - Integrated in Hadoop-trunk #597 (See http://hudson.zones.apache.org/hudson/job/Hadoop-trunk/597/ )
          Robert Chansler made changes -
          Release Note libhdfs modified to return NULL or error code when unrecoverable error occurs rather than exiting itself.
          Modified libhdfs to return NULL or error code when unrecoverable error occurs rather than exiting itself.
          Hadoop Flags [Reviewed, Incompatible change] [Incompatible change, Reviewed]
          Nigel Daley made changes -
          Status Resolved [ 5 ] Closed [ 6 ]
          Owen O'Malley made changes -
          Component/s libhdfs [ 12311345 ]
          Transition Time In Source Status Execution Times Last Executer Last Execution Date
          Patch Available Patch Available Open Open
          12d 23h 26m 1 Owen O'Malley 28/Aug/08 22:43
          Open Open Patch Available Patch Available
          8d 22h 11m 2 Pete Wyckoff 06/Sep/08 20:46
          Patch Available Patch Available Resolved Resolved
          1d 10h 42m 1 dhruba borthakur 08/Sep/08 07:29
          Resolved Resolved Closed Closed
          73d 17h 9m 1 Nigel Daley 20/Nov/08 23:38

            People

            • Assignee:
              Pete Wyckoff
              Reporter:
              Pete Wyckoff
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development