HBASE-4773 HBaseAdmin may leak ZooKeeper connections (Xufeng)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1207297 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2011-11-28 15:30:55 +00:00
parent 4368ce9401
commit d88f53bced
2 changed files with 5 additions and 0 deletions

View File

@ -873,6 +873,7 @@ Release 0.90.5 - Unreleased
HBASE-4848 TestScanner failing because hostname can't be null HBASE-4848 TestScanner failing because hostname can't be null
HBASE-4862 Splitting hlog and opening region concurrently may cause data loss HBASE-4862 Splitting hlog and opening region concurrently may cause data loss
(Chunhui Shen) (Chunhui Shen)
HBASE-4773 HBaseAdmin may leak ZooKeeper connections (Xufeng)
IMPROVEMENT IMPROVEMENT
HBASE-4205 Enhance HTable javadoc (Eric Charles) HBASE-4205 Enhance HTable javadoc (Eric Charles)

View File

@ -116,10 +116,14 @@ public class HBaseAdmin implements Abortable, Closeable {
Thread.sleep(getPauseTime(tries)); Thread.sleep(getPauseTime(tries));
} catch (InterruptedException e) { } catch (InterruptedException e) {
Thread.currentThread().interrupt(); Thread.currentThread().interrupt();
// we should delete connection between client and zookeeper
HConnectionManager.deleteStaleConnection(this.connection);
throw new MasterNotRunningException("Interrupted"); throw new MasterNotRunningException("Interrupted");
} }
} }
if (tries >= numRetries) { if (tries >= numRetries) {
// we should delete connection between client and zookeeper
HConnectionManager.deleteStaleConnection(this.connection);
throw new MasterNotRunningException("Retried " + numRetries + " times"); throw new MasterNotRunningException("Retried " + numRetries + " times");
} }
} }