This is an automated email from the ASF dual-hosted git repository.
wchevreuil pushed a commit to branch branch-2.6
in repository https://gitbox.apache.org/repos/asf/hbase.git
The following commit(s) were added to refs/heads/branch-2.6 by this push:
new 8ceaa537794 HBASE-30300 ADDENDUM: This is a branch-2 only addendum to
add throttling time check already present in master and branch-3 (#8516)
8ceaa537794 is described below
commit 8ceaa537794cba4cd30d66d2b597c37ffc2c4841
Author: Wellington Ramos Chevreuil <[email protected]>
AuthorDate: Thu Jul 30 20:49:25 2026 +0100
HBASE-30300 ADDENDUM: This is a branch-2 only addendum to add throttling
time check already present in master and branch-3 (#8516)
Signed-off-by: Tak Lon (Stephen) Wu <[email protected]>
---
.../hbase/master/balancer/CacheAwareLoadBalancer.java | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
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 23fa61417a0..21d62887b72 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 @@ public class CacheAwareLoadBalancer extends
StochasticLoadBalancer {
@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);
+ }
}
}
}