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


##########
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:
   @apoorvmittal10 
   We will propagate the message like in other cases.
   ```
   Error in read state RPC. Server response for 
SharePartitionKey{groupId=group1, 
topicIdPartition=YJ3W0zFZSoyslIZLI5033A:null-10} indicates version mismatch.
   ```
   
   This is the same case with other RPCs. The message is in line with other 
error response messages.
   
   HOWEVER, the client side ShareFetchRequest and ShareAcknowledgeRequest 
gobbles up the messages so they will only see the code and general message.
   
   
https://github.com/apache/kafka/blob/trunk/clients/src/main/java/org/apache/kafka/common/requests/ShareFetchRequest.java#L179
   
   
https://github.com/apache/kafka/blob/7199019b1554a6b3771b9bafb89cb4ad6b954856/clients/src/main/java/org/apache/kafka/common/requests/ShareAcknowledgeRequest.java#L108



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