HBASE-1042 OOME but we don't abort

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@722690 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2008-12-03 00:03:13 +00:00
parent ab7a3d33f2
commit d479c750de
4 changed files with 10 additions and 6 deletions

View File

@ -88,6 +88,7 @@ Release 0.19.0 - Unreleased
HBASE-1036 HBASE-1028 broke Thrift
HBASE-1037 Some test cases failing on Windows/Cygwin but not UNIX/Linux
HBASE-1041 Migration throwing NPE
HBASE-1042 OOME but we don't abort
IMPROVEMENTS
HBASE-901 Add a limit to key length, check key and value length on client side

View File

@ -77,12 +77,13 @@ public class Leases extends Thread {
Lease lease = null;
try {
lease = leaseQueue.poll(leaseCheckFrequency, TimeUnit.MILLISECONDS);
} catch (InterruptedException e) {
continue;
} catch (ConcurrentModificationException e) {
continue;
} catch (Throwable e) {
LOG.fatal("Unexpected exception killed leases thread", e);
break;
}
if (lease == null) {
continue;

View File

@ -608,8 +608,9 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
private boolean checkOOME(final Throwable e) {
boolean aborting = false;
if (e instanceof OutOfMemoryError ||
(e.getCause()!= null && e.getCause() instanceof OutOfMemoryError)) {
LOG.fatal("OOME, aborting.", e);
(e.getCause()!= null && e.getCause() instanceof OutOfMemoryError) ||
e.getMessage().contains("java.lang.OutOfMemoryError")) {
LOG.fatal("OutOfMemoryError, aborting.", e);
abort();
aborting = true;
}
@ -1871,7 +1872,8 @@ public class HRegionServer implements HConstants, HRegionInterface, Runnable {
*/
protected void checkOpen() throws IOException {
if (this.stopRequested.get() || this.abortRequested) {
throw new IOException("Server not running");
throw new IOException("Server not running" +
(this.abortRequested? ", aborting": ""));
}
if (!fsOk) {
throw new IOException("File system not available");