apoorvmittal10 commented on code in PR #17980: URL: https://github.com/apache/kafka/pull/17980#discussion_r1866676243
########## core/src/main/java/kafka/server/share/SharePartitionManager.java: ########## @@ -294,17 +294,26 @@ public CompletableFuture<Map<TopicIdPartition, ShareAcknowledgeResponseData.Part futures.put(topicIdPartition, future); } else { - futures.put(topicIdPartition, CompletableFuture.completedFuture(Errors.UNKNOWN_TOPIC_OR_PARTITION)); + futures.put(topicIdPartition, CompletableFuture.completedFuture(Errors.UNKNOWN_TOPIC_OR_PARTITION.exception())); } }); CompletableFuture<Void> allFutures = CompletableFuture.allOf( futures.values().toArray(new CompletableFuture[0])); return allFutures.thenApply(v -> { Map<TopicIdPartition, ShareAcknowledgeResponseData.PartitionData> result = new HashMap<>(); - futures.forEach((topicIdPartition, future) -> result.put(topicIdPartition, new ShareAcknowledgeResponseData.PartitionData() - .setPartitionIndex(topicIdPartition.partition()) - .setErrorCode(future.join().code()))); + futures.forEach((topicIdPartition, future) -> { + ShareAcknowledgeResponseData.PartitionData partitionData = new ShareAcknowledgeResponseData.PartitionData() + .setPartitionIndex(topicIdPartition.partition()); + Throwable t = future.join(); + if (t == null) { + partitionData.setErrorCode(Errors.NONE.code()); Review Comment: Though again this is not required to set, you can test it without setting the code as 0, by default it's 0. -- 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