CalvinConfluent commented on code in PR #16075: URL: https://github.com/apache/kafka/pull/16075#discussion_r1617983719
########## storage/src/main/java/org/apache/kafka/storage/internals/log/ProducerStateManager.java: ########## @@ -369,16 +369,21 @@ private boolean isProducerExpired(long currentTimeMs, ProducerStateEntry produce * Also expire any verification state entries that are lingering as unverified. */ public void removeExpiredProducers(long currentTimeMs) { - List<Long> keys = producers.entrySet().stream() - .filter(entry -> isProducerExpired(currentTimeMs, entry.getValue())) - .map(Map.Entry::getKey) - .collect(Collectors.toList()); + List<Long> keys = new ArrayList<>(); Review Comment: Updated. There is a significant improvement! -- 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