KAFKA-6362; Async auto-commit should discover coordinator if it is unknown (#4326)
Currently `maybeAutoCommitOffsetsAsync` does not try to find the coordinator if it is unknown. As a result, asynchronous auto-commits will fail indefinitely. This patch changes the behavior to add coordinator discovery to the async auto-commit path.
@ -528,6 +528,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
@@ -528,6 +528,7 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
publicvoidonSuccess(Voidvalue){
pendingAsyncCommits.decrementAndGet();
doCommitOffsetsAsync(offsets,callback);
client.pollNoWakeup();
}
@Override
@ -623,20 +624,10 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
@@ -623,20 +624,10 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
@ -650,8 +641,11 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
@@ -650,8 +641,11 @@ public final class ConsumerCoordinator extends AbstractCoordinator {
log.warn("Asynchronous auto-commit of offsets {} failed: {}",offsets,exception.getMessage());