From d479c750deede9ac4589ce1fbf8d159048e9ebf1 Mon Sep 17 00:00:00 2001 From: Michael Stack Date: Wed, 3 Dec 2008 00:03:13 +0000 Subject: [PATCH] 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 --- CHANGES.txt | 1 + src/java/org/apache/hadoop/hbase/Leases.java | 5 +++-- .../org/apache/hadoop/hbase/master/ServerManager.java | 2 +- .../apache/hadoop/hbase/regionserver/HRegionServer.java | 8 +++++--- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index 98193117e1f..2016936dabf 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -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 diff --git a/src/java/org/apache/hadoop/hbase/Leases.java b/src/java/org/apache/hadoop/hbase/Leases.java index 85f3c83b52d..c490f3b1876 100644 --- a/src/java/org/apache/hadoop/hbase/Leases.java +++ b/src/java/org/apache/hadoop/hbase/Leases.java @@ -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; diff --git a/src/java/org/apache/hadoop/hbase/master/ServerManager.java b/src/java/org/apache/hadoop/hbase/master/ServerManager.java index 0eeb697287f..449edc952d7 100644 --- a/src/java/org/apache/hadoop/hbase/master/ServerManager.java +++ b/src/java/org/apache/hadoop/hbase/master/ServerManager.java @@ -758,4 +758,4 @@ class ServerManager implements HConstants { public boolean isDead(String serverName) { return deadServers.contains(serverName); } -} +} \ No newline at end of file diff --git a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java index 73e45d79e09..401ffec1b33 100644 --- a/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java +++ b/src/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java @@ -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");