Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
None
-
None
-
None
Description
Implementation of connection creation rate quotas in Kafka is dependent on two configurations:
The minimum possible values of these configuration is 1 as per the documentation. However, 1 as a minimum value for quota.window.num is invalid and leads to failure for calculation of rate as demonstrated below.
As a proof of the bug, the following unit test fails:
@Test public void testUseWithMinimumPossibleConfiguration() { final Rate r = new Rate(); MetricConfig config = new MetricConfig().samples(1).timeWindow(1, TimeUnit.SECONDS); Time elapsed = new MockTime(); r.record(config, 1.0, elapsed.milliseconds()); elapsed.sleep(100); r.record(config, 1.0, elapsed.milliseconds()); elapsed.sleep(1000); final Double observedRate = r.measure(config, elapsed.milliseconds()); assertFalse(Double.isNaN(observedRate)); }
Attachments
Issue Links
- links to