hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Akira AJISAKA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HDFS-7744) Fix potential NPE in DFSInputStream after setDropBehind or setReadahead is called
Date Sat, 07 Feb 2015 00:52:37 GMT

    [ https://issues.apache.org/jira/browse/HDFS-7744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14310342#comment-14310342
] 

Akira AJISAKA commented on HDFS-7744:
-------------------------------------

Thanks Colin for the report and the patch. Mostly looks good to me. Two comments:
# I suppose the name of the test method would be inconsistent with the added test case. Would
you create a new test method (such as testSeekAfterCloseBlockReader) and add the test case
there?
# (minor) Would you reverse the order to "{{fis.read() != -1}}" for code readability?
{code}
+         Assert.assertTrue(-1 != fis.read());
{code}

> Fix potential NPE in DFSInputStream after setDropBehind or setReadahead is called
> ---------------------------------------------------------------------------------
>
>                 Key: HDFS-7744
>                 URL: https://issues.apache.org/jira/browse/HDFS-7744
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: dfsclient
>    Affects Versions: 2.6.0
>            Reporter: Colin Patrick McCabe
>            Assignee: Colin Patrick McCabe
>         Attachments: HDFS-7744.001.patch
>
>
> Fix a potential NPE in DFSInputStream after setDropBehind or setReadahead is called.
 These functions clear the {{blockReader}}, but don't set {{blockEnd}} to -1, which could
lead to {{DFSInputStream#seek}} attempting to derference {{blockReader}} even though it is
{{null}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message