apoorvmittal10 commented on code in PR #20884:
URL: https://github.com/apache/kafka/pull/20884#discussion_r2526960518


##########
server-common/src/main/java/org/apache/kafka/server/share/persister/PersisterStateManager.java:
##########
@@ -399,14 +401,24 @@ public void onComplete(ClientResponse response) {
         }
 
         // Visibility for testing
-        Optional<Errors> checkNetworkError(ClientResponse response, 
BiConsumer<Errors, Exception> errorConsumer) {
+        Optional<Errors> checkResponseError(ClientResponse response, 
BiConsumer<Errors, Exception> errorConsumer) {
             if (response.hasResponse()) {
                 return Optional.empty();
             }
 
-            log.debug("Response for RPC {} with key {} is invalid - {}.", 
name(), this.partitionKey, response);
-
-            if (response.wasDisconnected()) {
+            log.debug("Response for RPC {} with key {} is invalid - {}", 
name(), this.partitionKey, response);
+
+            if (response.authenticationException() != null) {
+                log.error("Authentication exception", 
response.authenticationException());
+                Errors error = 
Errors.forException(response.authenticationException());
+                errorConsumer.accept(error, new 
AuthenticationException(String.format("Server response for %s indicates 
authentication exception.", this.partitionKey)));
+                return Optional.of(error);

Review Comment:
   My concern is that whether this string related to Authentication Issue will 
be sent back to client application? If yes then is it correct?



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

Reply via email to