dajac commented on a change in pull request #11864: URL: https://github.com/apache/kafka/pull/11864#discussion_r821929304
########## File path: clients/src/main/java/org/apache/kafka/clients/consumer/internals/ConsumerCoordinator.java ########## @@ -1003,6 +1003,9 @@ void invokeCompletedOffsetCommitCallbacks() { RequestFuture<Void> future = null; if (!coordinatorUnknown()) { future = doCommitOffsetsAsync(offsets, callback); + } else if (offsets.isEmpty()) { + // No need to lookup coordinator if offsets is empty since commit of empty offsets is completed locally. + future = doCommitOffsetsAsync(offsets, callback); Review comment: Oh.. I see. In this case, would it make sense to check `offsets.isEmpty()` first, then `!coordinatorUnknown()`, and the final else. That seems a bit more natural when reading it. -- 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