HBASE-2830 NotServingRegionException shouldn't log a stack trace

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@978796 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael Stack 2010-07-24 04:43:03 +00:00
parent 13cd010140
commit 237fbbc817
4 changed files with 23 additions and 3 deletions

View File

@ -798,6 +798,7 @@ Release 0.21.0 - Unreleased
other times its sequence id, etc. other times its sequence id, etc.
HBASE-2873 Minor clean up in basescanner; fix a log and make deletes of HBASE-2873 Minor clean up in basescanner; fix a log and make deletes of
region processing run in order region processing run in order
HBASE-2830 NotServingRegionException shouldn't log a stack trace
NEW FEATURES NEW FEATURES
HBASE-1961 HBase EC2 scripts HBASE-1961 HBase EC2 scripts

View File

@ -31,6 +31,7 @@ import org.apache.hadoop.hbase.HServerAddress;
import org.apache.hadoop.hbase.HTableDescriptor; import org.apache.hadoop.hbase.HTableDescriptor;
import org.apache.hadoop.hbase.KeyValue; import org.apache.hadoop.hbase.KeyValue;
import org.apache.hadoop.hbase.MasterNotRunningException; import org.apache.hadoop.hbase.MasterNotRunningException;
import org.apache.hadoop.hbase.NotServingRegionException;
import org.apache.hadoop.hbase.RemoteExceptionHandler; import org.apache.hadoop.hbase.RemoteExceptionHandler;
import org.apache.hadoop.hbase.TableNotFoundException; import org.apache.hadoop.hbase.TableNotFoundException;
import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor; import org.apache.hadoop.hbase.client.MetaScanner.MetaScannerVisitor;
@ -1474,8 +1475,21 @@ public class HConnectionManager {
LOG.debug("Failed all from " + request.address, e); LOG.debug("Failed all from " + request.address, e);
failed.addAll(request.allPuts()); failed.addAll(request.allPuts());
} catch (ExecutionException e) { } catch (ExecutionException e) {
// all go into the failed list. Throwable cause = e.getCause();
LOG.debug("Failed all from " + request.address, e); // Don't print stack trace if NSRE; NSRE is 'normal' operation.
if (cause instanceof NotServingRegionException) {
String msg = cause.getMessage();
if (msg != null && msg.length() > 0) {
// msg is the exception as a String... we just want first line.
msg = msg.split("[\\n\\r]+\\s*at")[0];
}
LOG.debug("Failed execution of all on " + request.address +
" because: " + msg);
} else {
// all go into the failed list.
LOG.debug("Failed execution of all on " + request.address,
e.getCause());
}
failed.addAll(request.allPuts()); failed.addAll(request.allPuts());
// Just give up, leaving the batch put list in an untouched/semi-committed state // Just give up, leaving the batch put list in an untouched/semi-committed state

View File

@ -918,7 +918,7 @@ public abstract class HBaseServer {
try { try {
value = call(call.param, call.timestamp); // make the call value = call(call.param, call.timestamp); // make the call
} catch (Throwable e) { } catch (Throwable e) {
LOG.info(getName()+", call "+call+": error: " + e, e); LOG.debug(getName()+", call "+call+": error: " + e, e);
errorClass = e.getClass().getName(); errorClass = e.getClass().getName();
error = StringUtils.stringifyException(e); error = StringUtils.stringifyException(e);
} }

View File

@ -811,6 +811,11 @@ public class HRegionServer implements HRegionInterface,
* @return Throwable converted to an IOE; methods can only let out IOEs. * @return Throwable converted to an IOE; methods can only let out IOEs.
*/ */
private Throwable cleanup(final Throwable t, final String msg) { private Throwable cleanup(final Throwable t, final String msg) {
// Don't log as error if NSRE; NSRE is 'normal' operation.
if (t instanceof NotServingRegionException) {
LOG.debug("NotServingRegionException; " + t.getMessage());
return t;
}
if (msg == null) { if (msg == null) {
LOG.error("", RemoteExceptionHandler.checkThrowable(t)); LOG.error("", RemoteExceptionHandler.checkThrowable(t));
} else { } else {