lianetm commented on code in PR #18737: URL: https://github.com/apache/kafka/pull/18737#discussion_r1946859102
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java: ########## @@ -414,7 +415,15 @@ private void process(final ResetOffsetEvent event) { */ private void process(final CheckAndUpdatePositionsEvent event) { CompletableFuture<Boolean> future = requestManagers.offsetsRequestManager.updateFetchPositions(event.deadlineMs()); - future.whenComplete(complete(event.future())); + future.whenComplete((value, exception) -> { + if (exception != null) + event.future().completeExceptionally(exception); + else { + requestManagers.commitRequestManager.ifPresent(commitRequestManager -> + commitRequestManager.setLatestPartitionOffsets(subscriptions.allConsumed())); Review Comment: uhm not really, but my bad that I was referring to making the asyncCommit completable but it already is, with a result to know with the requests receives a response and we shouldn't change that (needed for commit calbacks). We need to bring in another way of knowing when the AsyncCommitEvent has retrieved the offsets if we want to keep it in the background. That's the one that would complete as soon as the process gets subscription.allConsumed, and the app thread knows it's safe to continue (without waiting for a response to the async commit of course) -- 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