philipnee commented on code in PR #14710:
URL: https://github.com/apache/kafka/pull/14710#discussion_r1400064652


##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/CommitRequestManager.java:
##########
@@ -180,12 +188,47 @@ public void maybeAutoCommit(final Map<TopicPartition, 
OffsetAndMetadata> offsets
         autocommit.setInflightCommitStatus(true);
     }
 
+    /**
+     * The consumer needs to send an auto commit during the shutdown if 
autocommit is enabled.
+     */
+    Optional<NetworkClientDelegate.UnsentRequest> maybeAutoCommit() {
+        if (!autoCommitState.isPresent()) {
+            return Optional.empty();
+        }
+
+        OffsetCommitRequestState request = 
pendingRequests.createOffsetCommitRequest(subscriptions.allConsumed(), jitter);
+        
request.future.whenComplete(autoCommitCallback(subscriptions.allConsumed()));
+        return Optional.of(request.toUnsentRequest());
+    }
+
+   // Visible for testing
+    CompletableFuture<Void> sendAutoCommit(final Map<TopicPartition, 
OffsetAndMetadata> allConsumedOffsets) {

Review Comment:
   changed to `private`



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to