lianetm commented on code in PR #14557:
URL: https://github.com/apache/kafka/pull/14557#discussion_r1425982023


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -190,63 +179,90 @@ private static long findMinTime(final Collection<? 
extends RequestState> request
      * has elapsed.
      *
      * @param offsets Offsets to commit
+     * @param timer Time to continue retrying the request if it fails with a 
retriable error. If
+     *              not present, the request will be sent but not retried.
      * @return Future that will complete when a response is received for the 
request, or a
      * completed future if no request is generated.
      */
-    public CompletableFuture<Void> maybeAutoCommit(final Map<TopicPartition, 
OffsetAndMetadata> offsets) {
-        if (!canAutoCommit()) {
+    private CompletableFuture<Void> maybeAutoCommit(final Map<TopicPartition, 
OffsetAndMetadata> offsets,
+                                                    final Optional<Timer> 
timer,
+                                                    boolean checkInterval) {
+        if (!autoCommitState.isPresent()) {
+            log.debug("Skipping auto-commit because auto-commit config is not 
enabled.");
             return CompletableFuture.completedFuture(null);
         }
 
         AutoCommitState autocommit = autoCommitState.get();
-        if (!autocommit.shouldAutoCommit()) {
+        if (checkInterval && !autocommit.shouldAutoCommit()) {
+            log.debug("Skipping auto-commit, remaining time {}", 
autocommit.timer.remainingMs());

Review Comment:
   Good point. Actually even at trace seems like a lot, I will remove 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

Reply via email to