hadoop-hdfs-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Todd Lipcon (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HDFS-513) NameNode.getBlockLocations throws NPE when offset > filesize and file is not empty
Date Mon, 02 Nov 2009 23:52:59 GMT

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

Todd Lipcon commented on HDFS-513:
----------------------------------

This was fixed in trunk and branch-0.21 by HDFS-570.

I think it should be committed to branch-20 as well.

> NameNode.getBlockLocations throws NPE when offset > filesize and file is not empty
> ----------------------------------------------------------------------------------
>
>                 Key: HDFS-513
>                 URL: https://issues.apache.org/jira/browse/HDFS-513
>             Project: Hadoop HDFS
>          Issue Type: Bug
>          Components: name-node
>            Reporter: Todd Lipcon
>            Assignee: Todd Lipcon
>         Attachments: hdfs-513-trunk.txt, hdfs-513.txt
>
>
> in BlockManager.getBlockLocations, if the offset is past the end of a non-empty file,
it returns null. In FSNamesystem.getBlockLocationsInternal, this null is passed through to
inode.createLocatedBlocks, so it ends up with a LocatedBlocks instance whose .blocks is null.
This is then iterated over in FSNamesystem.getBlockLocations, and throws an NPE.
> Instead, I think BlockManager.getBlockLocations should return Collections.emptyList in
the past-EOF case. This would result in an empty list response from NN.getBlockLocations which
matches the behavior of an empty file. If this sounds like the appropriate fix I"ll attach
the patch.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message