HBASE-5282 Possible file handle leak with truncated HLog file
git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1236445 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
da1443d90a
commit
36788d1cc2
@ -2739,8 +2739,9 @@ public class HRegion implements HeapSize { // , Writable{
|
|||||||
MonitoredTask status = TaskMonitor.get().createStatus(msg);
|
MonitoredTask status = TaskMonitor.get().createStatus(msg);
|
||||||
|
|
||||||
status.setStatus("Opening logs");
|
status.setStatus("Opening logs");
|
||||||
HLog.Reader reader = HLog.getReader(this.fs, edits, conf);
|
HLog.Reader reader = null;
|
||||||
try {
|
try {
|
||||||
|
reader = HLog.getReader(this.fs, edits, conf);
|
||||||
long currentEditSeqId = minSeqId;
|
long currentEditSeqId = minSeqId;
|
||||||
long firstSeqIdInLog = -1;
|
long firstSeqIdInLog = -1;
|
||||||
long skippedEdits = 0;
|
long skippedEdits = 0;
|
||||||
@ -2871,8 +2872,10 @@ public class HRegion implements HeapSize { // , Writable{
|
|||||||
LOG.debug(msg);
|
LOG.debug(msg);
|
||||||
return currentEditSeqId;
|
return currentEditSeqId;
|
||||||
} finally {
|
} finally {
|
||||||
reader.close();
|
|
||||||
status.cleanup();
|
status.cleanup();
|
||||||
|
if (reader != null) {
|
||||||
|
reader.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user