mimaison commented on a change in pull request #8295:
URL: https://github.com/apache/kafka/pull/8295#discussion_r452374925



##########
File path: 
clients/src/main/java/org/apache/kafka/clients/consumer/internals/Fetcher.java
##########
@@ -994,30 +1023,29 @@ public void onSuccess(ClientResponse response, 
RequestFuture<ListOffsetResult> f
      *               value of each partition may be null only for v0. In v1 
and later the ListOffset API would not
      *               return a null timestamp (-1 is returned instead when 
necessary).
      */
-    private void handleListOffsetResponse(Map<TopicPartition, 
ListOffsetRequest.PartitionData> timestampsToSearch,
+    private void handleListOffsetResponse(Map<TopicPartition, 
ListOffsetPartition> timestampsToSearch,
                                           ListOffsetResponse 
listOffsetResponse,
                                           RequestFuture<ListOffsetResult> 
future) {
         Map<TopicPartition, ListOffsetData> fetchedOffsets = new HashMap<>();
         Set<TopicPartition> partitionsToRetry = new HashSet<>();
         Set<String> unauthorizedTopics = new HashSet<>();
 
-        for (Map.Entry<TopicPartition, ListOffsetRequest.PartitionData> entry 
: timestampsToSearch.entrySet()) {
+        Map<TopicPartition, ListOffsetPartitionResponse> partitionsData = 
byTopicPartitions(listOffsetResponse.responseData());

Review comment:
       We now added logic in the AdminClient to handle partial responses from 
brokers (based on 
https://github.com/apache/kafka/pull/8295#discussion_r449575550). Shouldn't we 
do the same here instead of assuming the response is always complete? I'm not 
even sure if we should retry if a resource is missing from the response but we 
could at least log it instead of hitting a NPE.




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

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


Reply via email to