dajac commented on code in PR #13240:
URL: https://github.com/apache/kafka/pull/13240#discussion_r1226607855


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java:
##########
@@ -1354,8 +1373,21 @@ public void handle(OffsetCommitResponse commitResponse, 
RequestFuture<Void> futu
             Set<String> unauthorizedTopics = new HashSet<>();
 
             for (OffsetCommitResponseData.OffsetCommitResponseTopic topic : 
commitResponse.data().topics()) {
+                String topicName = topic.name();
+
+                if (this.response.requestHeader().apiVersion() >= 9) {
+                    topicName = 
topicIdAndNames.topicNameOrNull(topic.topicId());
+
+                    if (topicName == null) {
+                        // Could only happen if the broker replied with an ID 
which was not in the request and
+                        // unknown by this client. This would be a bug.
+                        log.warn("Ignoring invalid topic ID found in 
OffsetCommit response: " + topic.topicId());
+                        continue;
+                    }

Review Comment:
   As a second thought, I wonder if we should complete the future with an 
exception here. Being defensive would help us to catch bugs early one. What do 
you think?



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

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

Reply via email to