Hadoop HDFS
  1. Hadoop HDFS
  2. HDFS-3371

EditLogFileInputStream: be more careful about closing streams when we're done with them.

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      EditLogFileInputStream#EditLogFileInputStream should be more careful about closing streams when there is an exception thrown. Also, EditLogFileInputStream#close should close all of the streams we opened in the constructor, not just one of them (although the file-backed one is probably the most important).

      1. HDFS-3371.002.patch
        1 kB
        Colin Patrick McCabe
      2. HDFS-3371.001.patch
        6 kB
        Colin Patrick McCabe

        Activity

        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12525659/HDFS-3371.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.

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

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

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

        +1 findbugs. The patch does not introduce any 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/2377//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2377//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/12525659/HDFS-3371.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. -1 javadoc. The javadoc tool appears to have generated 2 warning messages. +1 javac. The applied patch does not increase the total number of javac compiler warnings. +1 eclipse:eclipse. The patch built with eclipse:eclipse. +1 findbugs. The patch does not introduce any 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/2377//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2377//console This message is automatically generated.
        Hide
        Colin Patrick McCabe added a comment -
        • rebase
        Show
        Colin Patrick McCabe added a comment - rebase
        Hide
        Hadoop QA added a comment -

        -1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12530087/HDFS-3371.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 does not introduce any 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/2535//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2535//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/12530087/HDFS-3371.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 does not introduce any 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/2535//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/2535//console This message is automatically generated.
        Hide
        Todd Lipcon added a comment -

        I'm not sure I see the point of this change. It only changes EditLogBackupInputStream, where closing is a no-op anyway. And closing all of in, tracker, inner isn't necessary, since the wrapper streams will pass through the close to the streams that they wrap already.

        Show
        Todd Lipcon added a comment - I'm not sure I see the point of this change. It only changes EditLogBackupInputStream, where closing is a no-op anyway. And closing all of in, tracker, inner isn't necessary, since the wrapper streams will pass through the close to the streams that they wrap already.
        Hide
        Colin Patrick McCabe added a comment -

        Currently, this code gets an NPE:

        EditLogBackupInputStream elbis = new EditLogBackupInputStream(...);
        elbis.close();
        

        so that seems incorrect.

        Also, if there are exceptions, you can't really assume that all of the streams will exist in EditLogBackupInputStream#close.

        Yeah, it's a minor nit, so it's really up to you guys whether it's worth it to submit such a small fix. But I'd rather have it than not, personally.

        Show
        Colin Patrick McCabe added a comment - Currently, this code gets an NPE: EditLogBackupInputStream elbis = new EditLogBackupInputStream(...); elbis.close(); so that seems incorrect. Also, if there are exceptions, you can't really assume that all of the streams will exist in EditLogBackupInputStream#close. Yeah, it's a minor nit, so it's really up to you guys whether it's worth it to submit such a small fix. But I'd rather have it than not, personally.
        Hide
        Colin Patrick McCabe added a comment -

        I guess there's no point in doing this one as the outer stream will close all the inner ones.

        Show
        Colin Patrick McCabe added a comment - I guess there's no point in doing this one as the outer stream will close all the inner ones.

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development