You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/09/24 12:35:35 UTC

[GitHub] [kafka] dongjinleekr commented on a change in pull request #11353: KAFKA-13322: Reducing amount of garbage that gets generated during a poll operation

dongjinleekr commented on a change in pull request #11353:
URL: https://github.com/apache/kafka/pull/11353#discussion_r715574255



##########
File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
##########
@@ -1153,7 +1155,9 @@ private void handleListOffsetResponse(ListOffsetsResponse listOffsetsResponse,
         for (CompletedFetch completedFetch : completedFetches) {
             exclude.add(completedFetch.partition);
         }
-        return subscriptions.fetchablePartitions(tp -> !exclude.contains(tp));
+        // Need to clear the buffer first otherwise it will contain results from the previous fetch
+        fetchablePartitionsResultBuffer.clear();

Review comment:
       I love this approach; however, could you kindly add some justification comments on why `fetchablePartitionsResultBuffer` should be a shared state here?




-- 
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-unsubscribe@kafka.apache.org

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