chia7712 commented on code in PR #23532:
URL: https://github.com/apache/kafka/pull/23532#discussion_r4070107240


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ShareFetch.java:
##########
@@ -67,14 +67,15 @@ private ShareFetch(Map<TopicIdPartition, 
List<ShareInFlightBatch<K, V>>> batches
      */
     public void add(TopicIdPartition partition, ShareInFlightBatch<K, V> 
batch) {
         Objects.requireNonNull(batch);
-        batches.computeIfAbsent(partition, k -> new LinkedList<>()).add(batch);
+        batches.computeIfAbsent(partition, k -> new ArrayList<>()).add(batch);
         if (batch.getAcquisitionLockTimeoutMs().isPresent()) {
             acquisitionLockTimeoutMs = batch.getAcquisitionLockTimeoutMs();
         }
     }
 
     /**
-     * @return all the non-control messages for this fetch, grouped by 
partition
+     * @return all the non-control messages for this fetch, grouped by 
partition. Partitions with no
+     * in-flight records (such as those whose acquired offsets were all 
control records) are omitted.
      */
     public Map<TopicPartition, List<ConsumerRecord<K, V>>> records() {
         final LinkedHashMap<TopicPartition, List<ConsumerRecord<K, V>>> result 
= new LinkedHashMap<>();

Review Comment:
   Trunk only is fine. 4.4.0 already has enough surprises 😀



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