hachikuji commented on code in PR #12611:
URL: https://github.com/apache/kafka/pull/12611#discussion_r967541336


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AbstractCoordinator.java:
##########
@@ -249,7 +249,14 @@ protected synchronized boolean 
ensureCoordinatorReady(final Timer timer) {
                 throw fatalException;
             }
             final RequestFuture<Void> future = lookupCoordinator();
-            client.poll(future, timer);
+
+            // if we do not want to block on discovering coordinator at all,
+            // then we should not try to poll in a loop, and should not throw 
wake-up exception either
+            if (timer.timeoutMs() == 0L) {

Review Comment:
   I wonder if this breaks the API in a different way. If the user calls 
`wakeup()`, would we expect the next blocking call to trigger a wakeup even if 
it were called with a timeout of zero? I wonder if it would be better to 
overload `ensureCoordinatorReady` with an additional flag?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to