hbase-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmhs...@apache.org
Subject svn commit: r1236446 - in /hbase/branches/0.92: CHANGES.txt src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
Date Thu, 26 Jan 2012 23:32:14 GMT
Author: jmhsieh
Date: Thu Jan 26 23:32:14 2012
New Revision: 1236446

URL: http://svn.apache.org/viewvc?rev=1236446&view=rev
Log:
HBASE-5282 Possible file handle leak with truncated HLog file


Modified:
    hbase/branches/0.92/CHANGES.txt
    hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java

Modified: hbase/branches/0.92/CHANGES.txt
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/CHANGES.txt?rev=1236446&r1=1236445&r2=1236446&view=diff
==============================================================================
--- hbase/branches/0.92/CHANGES.txt (original)
+++ hbase/branches/0.92/CHANGES.txt Thu Jan 26 23:32:14 2012
@@ -9,6 +9,7 @@ Release 0.92.1 - Unreleased
    HBASE-5176  AssignmentManager#getRegion: logging nit  adds a redundant '+' (Karthik K)
    HBASE-5278  HBase shell script refers to removed "migrate" functionality
                (Shaneal Manek)
+   HBASE-5282  Possible file handle leak with truncated HLog file
 
   TESTS
    HBASE-5223  TestMetaReaderEditor is missing call to CatalogTracker.stop()

Modified: hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java
URL: http://svn.apache.org/viewvc/hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java?rev=1236446&r1=1236445&r2=1236446&view=diff
==============================================================================
--- hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java (original)
+++ hbase/branches/0.92/src/main/java/org/apache/hadoop/hbase/regionserver/HRegion.java Thu
Jan 26 23:32:14 2012
@@ -2337,8 +2337,9 @@ public class HRegion implements HeapSize
     MonitoredTask status = TaskMonitor.get().createStatus(msg);
 
     status.setStatus("Opening logs");
-    HLog.Reader reader = HLog.getReader(this.fs, edits, conf);
+    HLog.Reader reader = null;
     try {
+      reader = HLog.getReader(this.fs, edits, conf);
       long currentEditSeqId = minSeqId;
       long firstSeqIdInLog = -1;
       long skippedEdits = 0;
@@ -2469,8 +2470,10 @@ public class HRegion implements HeapSize
       LOG.debug(msg);
       return currentEditSeqId;
     } finally {
-      reader.close();
       status.cleanup();
+      if (reader != null) {  
+         reader.close();
+      }
     }
   }
 



Mime
View raw message