Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-470

libhdfs should handle 0-length reads from FSInputStream correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.0.2-alpha
    • Component/s: None
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      libhdfs changes Java read semantics to posix semantics. As such, if Hadoop ever returns 0 bytes read, libhdfs should return -1 and set errno = EINTER.

      1. HDFS-470.002.patch
        2 kB
        Colin Patrick McCabe
      2. HDFS-470.001.patch
        0.7 kB
        Colin Patrick McCabe

        Activity

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open Patch Available Patch Available
        1333d 16h 37m 1 Colin Patrick McCabe 06/Jul/12 19:55
        Patch Available Patch Available Resolved Resolved
        7d 5h 11m 1 Eli Collins 14/Jul/12 01:06
        Resolved Resolved Closed Closed
        89d 17h 39m 1 Arun C Murthy 11/Oct/12 18:46
        Arun C Murthy made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Arun C Murthy made changes -
        Fix Version/s 2.0.2-alpha [ 12322472 ]
        Fix Version/s 2.1.0-alpha [ 12321440 ]
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk #1136 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1136/)
        HDFS-470. libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446)

        Result = SUCCESS
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk #1136 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/1136/ ) HDFS-470 . libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk #1103 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1103/)
        HDFS-470. libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446)

        Result = FAILURE
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk #1103 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/1103/ ) HDFS-470 . libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446) Result = FAILURE eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Hdfs-trunk-Commit #2534 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2534/)
        HDFS-470. libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446)

        Result = SUCCESS
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Show
        Hudson added a comment - Integrated in Hadoop-Hdfs-trunk-Commit #2534 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Commit/2534/ ) HDFS-470 . libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Common-trunk-Commit #2469 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2469/)
        HDFS-470. libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446)

        Result = SUCCESS
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Show
        Hudson added a comment - Integrated in Hadoop-Common-trunk-Commit #2469 (See https://builds.apache.org/job/Hadoop-Common-trunk-Commit/2469/ ) HDFS-470 . libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446) Result = SUCCESS eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Hide
        Hudson added a comment -

        Integrated in Hadoop-Mapreduce-trunk-Commit #2488 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2488/)
        HDFS-470. libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446)

        Result = FAILURE
        eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446
        Files :

        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c
        • /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Show
        Hudson added a comment - Integrated in Hadoop-Mapreduce-trunk-Commit #2488 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Commit/2488/ ) HDFS-470 . libhdfs should handle 0-length reads from FSInputStream correctly. Contributed by Colin Patrick McCabe (Revision 1361446) Result = FAILURE eli : http://svn.apache.org/viewcvs.cgi/?root=Apache-SVN&view=rev&rev=1361446 Files : /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.c /hadoop/common/trunk/hadoop-hdfs-project/hadoop-hdfs/src/main/native/hdfs.h
        Eli Collins made changes -
        Status Patch Available [ 10002 ] Resolved [ 5 ]
        Hadoop Flags Reviewed [ 10343 ]
        Fix Version/s 2.0.1-alpha [ 12321440 ]
        Resolution Fixed [ 1 ]
        Hide
        Eli Collins added a comment -

        +1 looks good

        I've committed this to trunk and merged to branch-2. Thanks Colin.

        Show
        Eli Collins added a comment - +1 looks good I've committed this to trunk and merged to branch-2. Thanks Colin.
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12535943/HDFS-470.002.patch
        against trunk revision .

        +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 new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

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

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        -1 findbugs. The patch appears to introduce 2 new Findbugs (version 1.3.9) warnings.

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

        +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//testReport/
        Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-hdfs.html
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//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/12535943/HDFS-470.002.patch against trunk revision . +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 new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 javadoc. The javadoc tool did not generate any warning messages. +1 eclipse:eclipse. The patch built with eclipse:eclipse. -1 findbugs. The patch appears to introduce 2 new Findbugs (version 1.3.9) warnings. +1 release audit. The applied patch does not increase the total number of release audit warnings. +1 core tests. The patch passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests. The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//testReport/ Findbugs warnings: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//artifact/trunk/patchprocess/newPatchFindbugsWarningshadoop-hdfs.html Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2780//console This message is automatically generated.
        Colin Patrick McCabe made changes -
        Attachment HDFS-470.002.patch [ 12535943 ]
        Hide
        Colin Patrick McCabe added a comment -
        • in the header file, add better documentation about the possible return values of hdfsRead
        Show
        Colin Patrick McCabe added a comment - in the header file, add better documentation about the possible return values of hdfsRead
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12535403/HDFS-470.001.patch
        against trunk revision .

        +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 new tests are needed for this patch.
        Also please list what manual steps were performed to verify this patch.

        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2751//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/12535403/HDFS-470.001.patch against trunk revision . +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 new tests are needed for this patch. Also please list what manual steps were performed to verify this patch. Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2751//console This message is automatically generated.
        Colin Patrick McCabe made changes -
        Status Open [ 1 ] Patch Available [ 10002 ]
        Colin Patrick McCabe made changes -
        Attachment HDFS-470.001.patch [ 12535403 ]
        Colin Patrick McCabe made changes -
        Summary libhdfs issue warning if FSDataInputStream returns invalid return value libhdfs should handle 0-length reads from FSInputStream correctly
        Issue Type Improvement [ 4 ] Bug [ 1 ]
        Priority Major [ 3 ] Minor [ 4 ]
        Hide
        Colin Patrick McCabe added a comment -

        POSIX does have a way of conveying "failed to read any bytes, but we're not at EOF." It's called EINTR. We should return this errno code when Java returns 0 from a read (as opposed to -1, which means EOF in Java.)

        Show
        Colin Patrick McCabe added a comment - POSIX does have a way of conveying "failed to read any bytes, but we're not at EOF." It's called EINTR. We should return this errno code when Java returns 0 from a read (as opposed to -1, which means EOF in Java.)
        Colin Patrick McCabe made changes -
        Assignee Colin Patrick McCabe [ cmccabe ]
        Description libhdfs changes Java read semantics to posix semantics. As such, if Hadoop ever returns 0 bytes read, libhdfs has no way of communicating this to the caller.

        So, it should at least issue a warning to stderr.
        libhdfs changes Java read semantics to posix semantics. As such, if Hadoop ever returns 0 bytes read, libhdfs should return -1 and set errno = EINTER.
        Owen O'Malley made changes -
        Field Original Value New Value
        Project Hadoop Common [ 12310240 ] Hadoop HDFS [ 12310942 ]
        Key HADOOP-4630 HDFS-470
        Component/s libhdfs [ 12311345 ]
        Pete Wyckoff created issue -

          People

          • Assignee:
            Colin Patrick McCabe
            Reporter:
            Pete Wyckoff
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development