hadoop-hdfs-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject svn commit: r1395727 - in /hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs: CHANGES.HDFS-3077.txt src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java
Date Mon, 08 Oct 2012 19:11:49 GMT
Author: todd
Date: Mon Oct  8 19:11:48 2012
New Revision: 1395727

URL: http://svn.apache.org/viewvc?rev=1395727&view=rev
Log:
HDFS-4017. Unclosed FileInputStream in GetJournalEditServlet. Contributed by Chao Shi.

Modified:
    hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt
    hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java

Modified: hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt?rev=1395727&r1=1395726&r2=1395727&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt
(original)
+++ hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/CHANGES.HDFS-3077.txt
Mon Oct  8 19:11:48 2012
@@ -84,3 +84,5 @@ HDFS-3955. QJM: Make acceptRecovery() at
 HDFS-3956. QJM: purge temporary files when no longer within retention period (todd)
 
 HDFS-4004. TestJournalNode#testJournal fails because of test case execution order (Chao Shi
via todd)
+
+HDFS-4017. Unclosed FileInputStream in GetJournalEditServlet (Chao Shi via todd)

Modified: hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java
URL: http://svn.apache.org/viewvc/hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java?rev=1395727&r1=1395726&r2=1395727&view=diff
==============================================================================
--- hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java
(original)
+++ hadoop/common/branches/HDFS-3077/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/qjournal/server/GetJournalEditServlet.java
Mon Oct  8 19:11:48 2012
@@ -46,6 +46,7 @@ import org.apache.hadoop.hdfs.server.nam
 import org.apache.hadoop.hdfs.server.namenode.TransferFsImage;
 import org.apache.hadoop.hdfs.server.protocol.NamespaceInfo;
 import org.apache.hadoop.hdfs.util.DataTransferThrottler;
+import org.apache.hadoop.io.IOUtils;
 import org.apache.hadoop.security.SecurityUtil;
 import org.apache.hadoop.security.UserGroupInformation;
 import org.apache.hadoop.util.ServletUtil;
@@ -157,6 +158,7 @@ public class GetJournalEditServlet exten
   @Override
   public void doGet(final HttpServletRequest request,
       final HttpServletResponse response) throws ServletException, IOException {
+    FileInputStream editFileIn = null;
     try {
       final ServletContext context = getServletContext();
       final Configuration conf = (Configuration) getServletContext()
@@ -181,8 +183,7 @@ public class GetJournalEditServlet exten
 
       FileJournalManager fjm = storage.getJournalManager();
       File editFile;
-      FileInputStream editFileIn;
-      
+
       synchronized (fjm) {
         // Synchronize on the FJM so that the file doesn't get finalized
         // out from underneath us while we're in the process of opening
@@ -209,6 +210,8 @@ public class GetJournalEditServlet exten
       String errMsg = "getedit failed. " + StringUtils.stringifyException(t);
       response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errMsg);
       throw new IOException(errMsg);
+    } finally {
+      IOUtils.closeStream(editFileIn);
     }
   }
 



Mime
View raw message