dajac commented on a change in pull request #11599:
URL: https://github.com/apache/kafka/pull/11599#discussion_r793362056
##########
File path:
clients/src/main/java/org/apache/kafka/common/requests/DescribeLogDirsResponse.java
##########
@@ -52,6 +52,7 @@ public int throttleTimeMs() {
@Override
public Map<Errors, Integer> errorCounts() {
Map<Errors, Integer> errorCounts = new HashMap<>();
+ errorCounts.put(Errors.forCode(data.errorCode()), 1);
Review comment:
Do we need to cover it in `testErrorCountsIncludesNone`?
##########
File path:
clients/src/main/java/org/apache/kafka/clients/admin/KafkaAdminClient.java
##########
@@ -2681,8 +2681,11 @@ public void handleResponse(AbstractResponse
abstractResponse) {
if (descriptions.size() > 0) {
future.complete(descriptions);
} else {
- // descriptions will be empty if and only if the user
is not authorized to describe cluster resource.
-
future.completeExceptionally(Errors.CLUSTER_AUTHORIZATION_FAILED.exception());
+ // Up to v3 DescribeLogDirsResponse did not have an
error code field, hence it defaults to None
+ Errors error = response.data().errorCode() ==
Errors.NONE.code()
Review comment:
@mimaison What would happen if DescribeLogDirsResponse v3 actually
returns NONE as an error (the default value)? It seems to be that we need to
take the version into account here as well.
--
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]