Yunyung commented on code in PR #17980: URL: https://github.com/apache/kafka/pull/17980#discussion_r1866962049
########## 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: I rethought it, and you are right :) Let's remove setting the error code if no error. Thanks for the great review! -- 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