kirktrue commented on code in PR #19917:
URL: https://github.com/apache/kafka/pull/19917#discussion_r2153170900


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/TopicMetadataRequestManager.java:
##########
@@ -84,16 +84,21 @@ public TopicMetadataRequestManager(final LogContext 
context, final Time time, fi
     @Override
     public NetworkClientDelegate.PollResult poll(final long currentTimeMs) {
         // Prune any requests which have timed out
-        List<TopicMetadataRequestState> expiredRequests = 
inflightRequests.stream()
-                .filter(TimedRequestState::isExpired)
-                .collect(Collectors.toList());
+        List<TopicMetadataRequestState> expiredRequests = new ArrayList<>();
+
+        for (TopicMetadataRequestState requestState : inflightRequests) {
+            if (requestState.isExpired())
+                expiredRequests.add(requestState);
+        }
+
         expiredRequests.forEach(TopicMetadataRequestState::expire);

Review Comment:
   Done.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to