Return-Path: Delivered-To: apmail-hadoop-core-commits-archive@www.apache.org Received: (qmail 49197 invoked from network); 1 Mar 2008 00:34:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 1 Mar 2008 00:34:20 -0000 Received: (qmail 96215 invoked by uid 500); 1 Mar 2008 00:34:15 -0000 Delivered-To: apmail-hadoop-core-commits-archive@hadoop.apache.org Received: (qmail 96189 invoked by uid 500); 1 Mar 2008 00:34:15 -0000 Mailing-List: contact core-commits-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: core-dev@hadoop.apache.org Delivered-To: mailing list core-commits@hadoop.apache.org Received: (qmail 96180 invoked by uid 99); 1 Mar 2008 00:34:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 29 Feb 2008 16:34:15 -0800 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.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 01 Mar 2008 00:33:36 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 18E051A983A; Fri, 29 Feb 2008 16:33:57 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r632510 - in /hadoop/core/trunk: CHANGES.txt src/java/org/apache/hadoop/dfs/FSNamesystem.java Date: Sat, 01 Mar 2008 00:33:56 -0000 To: core-commits@hadoop.apache.org From: dhruba@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080301003357.18E051A983A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dhruba Date: Fri Feb 29 16:33:56 2008 New Revision: 632510 URL: http://svn.apache.org/viewvc?rev=632510&view=rev Log: HADOOP-2918. Improve error logging so that dfs writes failure with "No lease on file" can be diagnosed. (dhruba) Modified: hadoop/core/trunk/CHANGES.txt hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Modified: hadoop/core/trunk/CHANGES.txt URL: http://svn.apache.org/viewvc/hadoop/core/trunk/CHANGES.txt?rev=632510&r1=632509&r2=632510&view=diff ============================================================================== --- hadoop/core/trunk/CHANGES.txt (original) +++ hadoop/core/trunk/CHANGES.txt Fri Feb 29 16:33:56 2008 @@ -188,6 +188,9 @@ HADOOP-2904. Fix to RPC metrics to log the correct host name. (girish vaitheeswaran via dhruba) + HADOOP-2918. Improve error logging so that dfs writes failure with + "No lease on file" can be diagnosed. (dhruba) + Release 0.16.0 - 2008-02-07 INCOMPATIBLE CHANGES Modified: hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java URL: http://svn.apache.org/viewvc/hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java?rev=632510&r1=632509&r2=632510&view=diff ============================================================================== --- hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java (original) +++ hadoop/core/trunk/src/java/org/apache/hadoop/dfs/FSNamesystem.java Fri Feb 29 16:33:56 2008 @@ -1172,8 +1172,21 @@ private INodeFileUnderConstruction checkLease(String src, String holder ) throws IOException { INode file = dir.getFileINode(src); - if (file == null || !file.isUnderConstruction()) { - throw new LeaseExpiredException("No lease on " + src); + if (file == null) { + Lease lease = getLease(holder); + throw new LeaseExpiredException("No lease on " + src + + " File does not exist. " + + (lease != null ? lease.toString() : + "Holder " + holder + + " does not have any open files.")); + } + if (!file.isUnderConstruction()) { + Lease lease = getLease(holder); + throw new LeaseExpiredException("No lease on " + src + + " File is not open for writing. " + + (lease != null ? lease.toString() : + "Holder " + holder + + " does not have any open files.")); } INodeFileUnderConstruction pendingFile = (INodeFileUnderConstruction)file; if (holder != null && !pendingFile.getClientName().equals(holder)) {