philipnee commented on code in PR #13380: URL: https://github.com/apache/kafka/pull/13380#discussion_r1143891018
########## clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java: ########## @@ -137,31 +166,21 @@ CompletableFuture<ClientResponse> sendAutoCommit(final Map<TopicPartition, Offse } return null; }); - return future; - } - - public void clientPoll(final long currentTimeMs) { - this.autoCommitState.ifPresent(t -> t.ack(currentTimeMs)); } - // Visible for testing - Queue<StagedCommit> stagedCommits() { - return this.stagedCommits; - } - private class StagedCommit { + private class UnsentOffsetCommitRequest { private final Map<TopicPartition, OffsetAndMetadata> offsets; private final String groupId; private final GroupState.Generation generation; private final String groupInstanceId; private final NetworkClientDelegate.FutureCompletionHandler future; - public StagedCommit(final Map<TopicPartition, OffsetAndMetadata> offsets, - final String groupId, - final String groupInstanceId, - final GroupState.Generation generation) { + public UnsentOffsetCommitRequest(final Map<TopicPartition, OffsetAndMetadata> offsets, + final String groupId, + final String groupInstanceId, + final GroupState.Generation generation) { this.offsets = offsets; - // if no callback is provided, DefaultOffsetCommitCallback will be used. Review Comment: I'm moving the Callback trigger entirely to the foreground thread. As you can see, the `PrototypeAsyncConsumer` invokes: ``` future.whenComplete((r, t) -> { if (t != null) { callback.onComplete(offsets, new KafkaException(t)); } else { callback.onComplete(offsets, null); } }); ``` -- 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