kirktrue commented on code in PR #20521:
URL: https://github.com/apache/kafka/pull/20521#discussion_r2418081315


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/NetworkClientDelegate.java:
##########
@@ -210,6 +210,30 @@ boolean doSend(final UnsentRequest r, final long 
currentTimeMs) {
         }
         ClientRequest request = makeClientRequest(r, node, currentTimeMs);
         if (!client.ready(node, currentTimeMs)) {
+            AuthenticationException authenticationException = 
client.authenticationException(node);
+
+            // The client may not be ready because it hit an unrecoverable 
authentication error. In that case, there's
+            // no benefit from retrying, so propagate the error here.

Review Comment:
   > Propagating auth errors to requests is core logic that already exists, in 
2 places actually : for requests that haven't been sent
   
   One of the unit/integration tests fails without this change (I'll have to 
remove this change and run the tests to remember which one).
   
   The test sets the consumer to fail with an authentication error, but the 
consumer doesn't fail as expected. The low-level code detects the 
authentication error, which is why `isReady()` returns `false`. For whatever 
reason, the request retries over and over again printing `Node is not ready, 
handle the request in the next event loop` until the test times out.
   
   I'll dig in some more to understand why the existing check isn't catching 
this case.



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