hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1372599 - in /hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs: ./ src/main/java/org/apache/hadoop/hdfs/server/namenode/
Date Mon, 13 Aug 2012 20:47:14 GMT
Author: todd
Date: Mon Aug 13 20:47:14 2012
New Revision: 1372599

URL: http://svn.apache.org/viewvc?rev=1372599&view=rev
Log:
HDFS-2330. In NNStorage.java, IOExceptions of stream closures can mask root exceptions. Contributed
by Uma Maheswara Rao G.

Modified:
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImagePreTransactionalStorageInspector.java
    hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt?rev=1372599&r1=1372598&r2=1372599&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt (original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt Mon Aug 13
20:47:14 2012
@@ -423,6 +423,9 @@ Release 2.0.1-alpha - UNRELEASED
 
     HDFS-3758. TestFuseDFS test failing. (Colin Patrick McCabe via eli)
 
+    HDFS-2330. In NNStorage.java, IOExceptions of stream closures can mask
+    root exceptions. (umamahesh via todd)
+
   BREAKDOWN OF HDFS-3042 SUBTASKS
 
     HDFS-2185. HDFS portion of ZK-based FailoverController (todd)

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImagePreTransactionalStorageInspector.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImagePreTransactionalStorageInspector.java?rev=1372599&r1=1372598&r2=1372599&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImagePreTransactionalStorageInspector.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/FSImagePreTransactionalStorageInspector.java
Mon Aug 13 20:47:14 2012
@@ -36,6 +36,7 @@ import org.apache.hadoop.hdfs.protocol.H
 import org.apache.hadoop.hdfs.server.common.Storage.StorageDirectory;
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeDirType;
 import org.apache.hadoop.hdfs.server.namenode.NNStorage.NameNodeFile;
+import org.apache.hadoop.io.IOUtils;
 
 /**
  * Inspects a FSImage storage directory in the "old" (pre-HDFS-1073) format.
@@ -130,8 +131,10 @@ class FSImagePreTransactionalStorageInsp
       DataInputStream in = new DataInputStream(new FileInputStream(timeFile));
       try {
         timeStamp = in.readLong();
-      } finally {
         in.close();
+        in = null;
+      } finally {
+        IOUtils.cleanup(LOG, in);
       }
     }
     return timeStamp;

Modified: hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java?rev=1372599&r1=1372598&r2=1372599&view=diff
==============================================================================
--- hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java
(original)
+++ hadoop/common/branches/branch-2/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/namenode/NNStorage.java
Mon Aug 13 20:47:14 2012
@@ -186,10 +186,12 @@ public class NNStorage extends Storage i
     try {
       oldFile.seek(0);
       int oldVersion = oldFile.readInt();
+      oldFile.close();
+      oldFile = null;
       if (oldVersion < LAST_PRE_UPGRADE_LAYOUT_VERSION)
         return false;
     } finally {
-      oldFile.close();
+      IOUtils.cleanup(LOG, oldFile);
     }
     return true;
   }
@@ -428,6 +430,8 @@ public class NNStorage extends Storage i
       BufferedReader br = new BufferedReader(new FileReader(txidFile));
       try {
         txid = Long.valueOf(br.readLine());
+        br.close();
+        br = null;
       } finally {
         IOUtils.cleanup(LOG, br);
       }
@@ -449,6 +453,8 @@ public class NNStorage extends Storage i
     try {
       fos.write(String.valueOf(txid).getBytes());
       fos.write('\n');
+      fos.close();
+      fos = null;
     } finally {
       IOUtils.cleanup(LOG, fos);
     }



Mime
View raw message