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


##########
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:
   For my knowledge: will this error message be transmitted to client 
application, if yes then why should it be? The Persister is internal component 
and not managed by the application developer, if there is an authetication 
issue then why the error should be transmitted to client?
   
   I checked handling of persister error in SharePartition, there are specific 
error codes for which the error is transmitted to client, but it does send the 
errorMessage for other exception types. So do we need to handle something in 
SharePartition?



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