kirktrue commented on code in PR #15640:
URL: https://github.com/apache/kafka/pull/15640#discussion_r1608607604
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/AsyncKafkaConsumer.java:
##########
@@ -1295,21 +1268,21 @@ private void close(Duration timeout, boolean
swallowException) {
void prepareShutdown(final Timer timer, final AtomicReference<Throwable>
firstException) {
if (!groupMetadata.get().isPresent())
return;
- maybeAutoCommitSync(autoCommitEnabled, timer);
+
+ if (autoCommitEnabled)
+ maybeAutoCommitSync(timer);
+
applicationEventHandler.add(new CommitOnCloseEvent());
completeQuietly(
() -> {
maybeRevokePartitions();
- applicationEventHandler.addAndGet(new
LeaveOnCloseEvent(timer), timer);
+ applicationEventHandler.addAndGet(new
LeaveOnCloseEvent(calculateDeadlineMs(timer)));
},
"Failed to send leaveGroup heartbeat with a timeout(ms)=" +
timer.timeoutMs(), firstException);
}
// Visible for testing
- void maybeAutoCommitSync(final boolean shouldAutoCommit,
- final Timer timer) {
- if (!shouldAutoCommit)
- return;
+ void maybeAutoCommitSync(final Timer timer) {
Review Comment:
Changed to just `autoCommitSync()`. Is that OK?
--
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]