divijvaidya commented on code in PR #12045: URL: https://github.com/apache/kafka/pull/12045#discussion_r862908032
########## clients/src/main/java/org/apache/kafka/common/metrics/stats/SampledStat.java: ########## @@ -87,8 +103,9 @@ public Sample oldest(long now) { Sample oldest = this.samples.get(0); for (int i = 1; i < this.samples.size(); i++) { Sample curr = this.samples.get(i); - if (curr.lastWindowMs < oldest.lastWindowMs) + if ((curr.getLastWindowMs() < oldest.getLastWindowMs()) && curr.isActive()) { // only consider active samples Review Comment: I have completely got rid of these changes. They were more from useful for defensive programming but changing the public APIs would have required a KIP and also complicated this code review. I will file a separate PR to add these defensive checks back. -- 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