HBASE-2388 Give a very explicit message when we figure a big GC pause

git-svn-id: https://svn.apache.org/repos/asf/hadoop/hbase/trunk@929194 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Jean-Daniel Cryans 2010-03-30 17:06:39 +00:00
parent ee3c65fb58
commit a84c14f3e4
2 changed files with 6 additions and 3 deletions

View File

@ -469,6 +469,7 @@ Release 0.21.0 - Unreleased
INFO or WARN
HBASE-2374 TableInputFormat - Configurable parameter to add column families
(Kay Kay via Stack)
HBASE-2388 Give a very explicit message when we figure a big GC pause
NEW FEATURES
HBASE-1961 HBase EC2 scripts

View File

@ -34,6 +34,7 @@ public class Sleeper {
private final Log LOG = LogFactory.getLog(this.getClass().getName());
private final int period;
private final AtomicBoolean stop;
private static final long TIME_FOR_WARNING = 30000;
/**
* @param sleep sleep time in milliseconds
@ -74,9 +75,10 @@ public class Sleeper {
Thread.sleep(waitTime);
woke = System.currentTimeMillis();
long slept = woke - now;
if (slept > (10L * this.period)) {
LOG.warn("We slept " + slept + "ms, ten times longer than scheduled: " +
this.period);
if (slept > TIME_FOR_WARNING) {
LOG.warn("We slept " + slept + "ms, this is likely due to a long " +
"garbage collecting pause and it's usually bad, " +
"see http://wiki.apache.org/hadoop/Hbase/Troubleshooting#A9");
}
} catch(InterruptedException iex) {
// We we interrupted because we're meant to stop? If not, just