From 63bdc72447f1ce17363ccb131c263caca5107b17 Mon Sep 17 00:00:00 2001 From: ndimiduk Date: Tue, 29 Apr 2014 14:51:26 +0000 Subject: [PATCH] HBASE-11082 Potential unclosed TraceScope in FSHLog#replaceWriter() git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1590997 13f79535-47bb-0310-9956-ffa450edef68 --- .../hadoop/hbase/regionserver/wal/FSHLog.java | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java index f52937e7fe9..fc9aa44f9f4 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/wal/FSHLog.java @@ -922,13 +922,16 @@ class FSHLog implements HLog, Syncable { LOG.error("Failed close of HLog writer " + oldPath + ", unflushedEntries=" + count, e); throw new FailedLogCloseException(oldPath + ", unflushedEntries=" + count, e); } finally { - // Let the writer thread go regardless, whether error or not. - if (zigzagLatch != null) { - zigzagLatch.releaseSafePoint(); - // It will be null if we failed our wait on safe point above. - if (syncFuture != null) blockOnSync(syncFuture); + try { + // Let the writer thread go regardless, whether error or not. + if (zigzagLatch != null) { + zigzagLatch.releaseSafePoint(); + // It will be null if we failed our wait on safe point above. + if (syncFuture != null) blockOnSync(syncFuture); + } + } finally { + scope.close(); } - scope.close(); } return newPath; }