You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2020/08/04 05:26:55 UTC

[GitHub] [kafka] apovzner commented on a change in pull request #9114: KAFKA-10162; Use Token Bucket algorithm for controller mutation quota (KIP-599, Part III)

apovzner commented on a change in pull request #9114:
URL: https://github.com/apache/kafka/pull/9114#discussion_r464807467



##########
File path: clients/src/main/java/org/apache/kafka/common/metrics/Sensor.java
##########
@@ -223,8 +229,14 @@ public void checkQuotas(long timeMs) {
                 Quota quota = config.quota();
                 if (quota != null) {
                     double value = metric.measurableValue(timeMs);
-                    if (!quota.acceptable(value)) {
-                        throw new QuotaViolationException(metric, value, quota.bound());
+                    if (metric.measurable() instanceof TokenBucket) {
+                        if (value <= 0) {

Review comment:
       we probably just want `value < 0` check here, right? Otherwise the throttle time will be 0 anyways.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org