Skip to content

Commit

Permalink
HBASE-25004 : Log RegionTooBusyException details (apache#2371)
Browse files Browse the repository at this point in the history
Signed-off-by: mnpoonia <apoonia@salesforce.com>
Signed-off-by: stack <stack@apache.org>
(cherry picked from commit 549bab7)

Change-Id: Ifaeaa7d2a29111c08088f2202e5df606477f66bd
  • Loading branch information
virajjasani committed Sep 19, 2020
1 parent 0963f8a commit bc42728
Showing 1 changed file with 20 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4455,12 +4455,17 @@ void checkResources() throws RegionTooBusyException {
requestFlush();
// Don't print current limit because it will vary too much. The message is used as a key
// over in RetriesExhaustedWithDetailsException processing.
throw new RegionTooBusyException("Over memstore limit=" +
org.apache.hadoop.hbase.procedure2.util.StringUtils.humanSize(this.blockingMemStoreSize) +
", regionName=" +
(this.getRegionInfo() == null? "unknown": this.getRegionInfo().getEncodedName()) +
", server=" + (this.getRegionServerServices() == null? "unknown":
this.getRegionServerServices().getServerName()));
final String regionName =
this.getRegionInfo() == null ? "unknown" : this.getRegionInfo().getEncodedName();
final String serverName = this.getRegionServerServices() == null ?
"unknown" : (this.getRegionServerServices().getServerName() == null ? "unknown" :
this.getRegionServerServices().getServerName().toString());
RegionTooBusyException rtbe = new RegionTooBusyException(
"Over memstore limit=" + org.apache.hadoop.hbase.procedure2.util.StringUtils
.humanSize(this.blockingMemStoreSize) + ", regionName=" + regionName + ", server="
+ serverName);
LOG.warn("Region is too busy due to exceeding memstore size limit.", rtbe);
throw rtbe;
}
}

Expand Down Expand Up @@ -8565,11 +8570,15 @@ private void lock(final Lock lock, final int multiplier)
if (!lock.tryLock(waitTime, TimeUnit.MILLISECONDS)) {
// Don't print millis. Message is used as a key over in
// RetriesExhaustedWithDetailsException processing.
throw new RegionTooBusyException("Failed to obtain lock; regionName=" +
(this.getRegionInfo() == null? "unknown":
this.getRegionInfo().getRegionNameAsString()) +
", server=" + (this.getRegionServerServices() == null? "unknown":
this.getRegionServerServices().getServerName()));
final String regionName =
this.getRegionInfo() == null ? "unknown" : this.getRegionInfo().getRegionNameAsString();
final String serverName = this.getRegionServerServices() == null ?
"unknown" : (this.getRegionServerServices().getServerName() == null ?
"unknown" : this.getRegionServerServices().getServerName().toString());
RegionTooBusyException rtbe = new RegionTooBusyException(
"Failed to obtain lock; regionName=" + regionName + ", server=" + serverName);
LOG.warn("Region is too busy to allow lock acquisition.", rtbe);
throw rtbe;
}
} catch (InterruptedException ie) {
LOG.info("Interrupted while waiting for a lock in region {}", this);
Expand Down

0 comments on commit bc42728

Please sign in to comment.