HBASE-10813 Possible over-catch of exceptions (Ding Yuan)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1586006 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
nkeywal 2014-04-09 16:11:06 +00:00
parent e17ef0d87b
commit c908da44d0
3 changed files with 10 additions and 6 deletions

View File

@ -152,13 +152,17 @@ public class CloseRegionHandler extends EventHandler {
regionInfo.getRegionNameAsString());
return;
}
} catch (Throwable t) {
// A throwable here indicates that we couldn't successfully flush the
} catch (KeeperException ke) {
server.abort("Unrecoverable exception while checking state with zk " +
regionInfo.getRegionNameAsString() + ", still finishing close", ke);
throw new RuntimeException(ke);
} catch (IOException ioe) {
// An IOException here indicates that we couldn't successfully flush the
// memstore before closing. So, we need to abort the server and allow
// the master to split our logs in order to recover the data.
server.abort("Unrecoverable exception while closing region " +
regionInfo.getRegionNameAsString() + ", still finishing close", t);
throw new RuntimeException(t);
regionInfo.getRegionNameAsString() + ", still finishing close", ioe);
throw new RuntimeException(ioe);
}
this.rsServices.removeFromOnlineRegions(region, destination);

View File

@ -1979,7 +1979,7 @@ class FSHLog implements HLog, Syncable {
Path logPath = new Path(args[i]);
FSUtils.setFsDefault(conf, logPath);
split(conf, logPath);
} catch (Throwable t) {
} catch (IOException t) {
t.printStackTrace(System.err);
System.exit(-1);
}

View File

@ -111,7 +111,7 @@ public class Merge extends Configured implements Tool {
try {
mergeTwoRegions();
return 0;
} catch (Exception e) {
} catch (IOException e) {
LOG.fatal("Merge failed", e);
return -1;