Index: src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java =================================================================== --- src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (revision 1211314) +++ src/main/java/org/apache/hadoop/hbase/catalog/CatalogTracker.java (working copy) @@ -105,6 +105,7 @@ private final MetaNodeTracker metaNodeTracker; private final AtomicBoolean metaAvailable = new AtomicBoolean(false); private boolean instantiatedzkw = false; + private Abortable abortable; /* * Do not clear this address once set. Its needed when we do @@ -184,8 +185,21 @@ this.connection = connection; if (abortable == null) { // A connection is abortable. - abortable = this.connection; + this.abortable = this.connection; } + Abortable throwableAborter = new Abortable() { + + @Override + public void abort(String why, Throwable e) { + throw new RuntimeException(why, e); + } + + @Override + public boolean isAborted() { + return true; + } + + }; if (zk == null) { // Create our own. Set flag so we tear it down on stop. this.zookeeper = @@ -195,10 +209,10 @@ } else { this.zookeeper = zk; } - this.rootRegionTracker = new RootRegionTracker(zookeeper, abortable); + this.rootRegionTracker = new RootRegionTracker(zookeeper, throwableAborter); final CatalogTracker ct = this; // Override nodeDeleted so we get notified when meta node deleted - this.metaNodeTracker = new MetaNodeTracker(zookeeper, abortable) { + this.metaNodeTracker = new MetaNodeTracker(zookeeper, throwableAborter) { public void nodeDeleted(String path) { if (!path.equals(node)) return; ct.resetMetaLocation(); @@ -216,8 +230,14 @@ */ public void start() throws IOException, InterruptedException { LOG.debug("Starting catalog tracker " + this); - this.rootRegionTracker.start(); - this.metaNodeTracker.start(); + try { + this.rootRegionTracker.start(); + this.metaNodeTracker.start(); + } catch (RuntimeException e) { + Throwable t = e.getCause(); + this.abortable.abort(e.getMessage(), t); + throw new IOException("Attempt to start root/meta tracker failed.", t); + } } /**