divijvaidya opened a new pull request, #12184:
URL: https://github.com/apache/kafka/pull/12184

   ## Problem
   Implementation of connection creation rate quotas in Kafka is dependent on 
two configurations:
   
[quota.window.num](https://kafka.apache.org/documentation.html#brokerconfigs_quota.window.num)
 AND 
[quota.window.size.seconds](https://kafka.apache.org/documentation.html#brokerconfigs_quota.window.size.seconds)
   
   The minimum possible values of these configuration is 1 as per the 
documentation. However, when we set 1 as the configuration value, we can hit a 
situation where rate is calculated as NaN (and hence, leads to exceptions). 
This specific scenario occurs when an event is recorded at the start of a 
sample window.
   
   ## Solution
   This patch fixes this edge case by ensuring that the windowSize over which 
Rate is calculated is at least 1ms (even if it is calculated at the start of 
the sample window).
   
   ## Test
   Added a unit test which fails before the patch and passes after the patch
   
   ### Committer Checklist (excluded from commit message)
   - [ ] Verify design and implementation 
   - [ ] Verify test coverage and CI build status
   - [ ] Verify documentation (including upgrade notes)
   


-- 
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.

To unsubscribe, e-mail: jira-unsubscr...@kafka.apache.org

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

Reply via email to