Return-Path: Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: (qmail 50814 invoked from network); 11 Aug 2009 00:09:30 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Aug 2009 00:09:30 -0000 Received: (qmail 79534 invoked by uid 500); 11 Aug 2009 00:09:37 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 79487 invoked by uid 500); 11 Aug 2009 00:09:37 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 79470 invoked by uid 99); 11 Aug 2009 00:09:37 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2009 00:09:36 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Aug 2009 00:09:35 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id F089229A001C for ; Mon, 10 Aug 2009 17:09:14 -0700 (PDT) Message-ID: <688557789.1249949354984.JavaMail.jira@brutus> Date: Mon, 10 Aug 2009 17:09:14 -0700 (PDT) From: "Todd Lipcon (JIRA)" To: hdfs-issues@hadoop.apache.org Subject: [jira] Updated: (HDFS-513) NameNode.getBlockLocations throws NPE when offset > filesize and file is not empty In-Reply-To: <118786470.1248911714812.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HDFS-513?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Todd Lipcon updated HDFS-513: ----------------------------- Status: Patch Available (was: Open) > 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 > 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.