AndrewJSchofield commented on code in PR #20737:
URL: https://github.com/apache/kafka/pull/20737#discussion_r2484913260


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareConsumeRequestManager.java:
##########
@@ -815,21 +816,26 @@ private void handleShareFetchSuccess(Node fetchTarget,
                     }
                 }
 
-                ShareCompletedFetch completedFetch = new ShareCompletedFetch(
+                completedFetches.add(
+                    new ShareCompletedFetch(
                         logContext,
                         BufferSupplier.create(),
                         fetchTarget.id(),
                         tip,
                         partitionData,
                         shareFetchMetricsAggregator,
-                        requestVersion);
-                shareFetchBuffer.add(completedFetch);
+                        requestVersion)
+                );
 
                 if (!partitionData.acquiredRecords().isEmpty()) {
                     fetchMoreRecords = false;
                 }
             }
 
+            if (!completedFetches.isEmpty()) {
+                shareFetchBuffer.add(completedFetches);

Review Comment:
   It's more to do with correctness. I'm going back into the callback stuff 
shortly, so I'll bear in mind your comment.



-- 
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