This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new c1fffdfd7 [SCB-2666]The bucket value logic is incorrect (#3278)
c1fffdfd7 is described below
commit c1fffdfd7f235d2613e8f4cb54808f8a06602c23
Author: hujinming <[email protected]>
AuthorDate: Thu Aug 11 21:16:33 2022 +0800
[SCB-2666]The bucket value logic is incorrect (#3278)
---
.../java/org/apache/servicecomb/qps/strategy/LeakyBucketStrategy.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/strategy/LeakyBucketStrategy.java
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/strategy/LeakyBucketStrategy.java
index 8e811c945..b8bf65c5e 100644
---
a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/strategy/LeakyBucketStrategy.java
+++
b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/strategy/LeakyBucketStrategy.java
@@ -47,7 +47,7 @@ public class LeakyBucketStrategy extends AbstractQpsStrategy {
throw new IllegalStateException("should not happen");
}
if (this.getBucketLimit() == null) {
- this.setBucketLimit(Math.max(2 * this.getQpsLimit(), Integer.MAX_VALUE));
+ this.setBucketLimit(Math.min(2 * this.getQpsLimit(), Integer.MAX_VALUE));
}
long nowTime = System.currentTimeMillis();
//get the num of te period time