diff --git a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java index 42fcee589002..0bd7cfc5be14 100644 --- a/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java +++ b/hbase-server/src/main/java/org/apache/hadoop/hbase/master/balancer/CacheAwareLoadBalancer.java @@ -322,12 +322,15 @@ private boolean serverHasCacheSpaceForRegion(BalancerClusterState cluster, int r @Override public void throttle(RegionPlan plan) { - synchronized (this) { - try { - // Release the monitor while waiting to avoid blocking other threads. - wait(getThrottleDurationMs(plan)); - } catch (InterruptedException e) { - throw new RuntimeException(e); + long throttlingTime = getThrottleDurationMs(plan); + if (throttlingTime > 0) { + synchronized (this) { + try { + // Release the monitor while waiting to avoid blocking other threads. + wait(getThrottleDurationMs(plan)); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } } }