From 97ec854f57d8d34e1fe0a2fefb893730dca99a1d Mon Sep 17 00:00:00 2001 From: Zhihong Yu Date: Sat, 28 Dec 2013 15:58:59 +0000 Subject: [PATCH] HBASE-10176 Canary#sniff() should close the HTable instance git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1553857 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/hadoop/hbase/tool/Canary.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java index eb536a3a6c9..3f3dfd32faa 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/tool/Canary.java @@ -472,13 +472,17 @@ public final class Canary implements Tool { return; } - for (HRegionInfo region : admin.getTableRegions(tableDesc.getName())) { - try { - sniffRegion(admin, sink, region, table); - } catch (Exception e) { - sink.publishReadFailure(region, e); - LOG.debug("sniffRegion failed", e); + try { + for (HRegionInfo region : admin.getTableRegions(tableDesc.getName())) { + try { + sniffRegion(admin, sink, region, table); + } catch (Exception e) { + sink.publishReadFailure(region, e); + LOG.debug("sniffRegion failed", e); + } } + } finally { + table.close(); } }