unknowntpo commented on code in PR #21584:
URL: https://github.com/apache/kafka/pull/21584#discussion_r2910100274
##########
clients/src/main/java/org/apache/kafka/clients/consumer/internals/events/ApplicationEventProcessor.java:
##########
@@ -289,23 +289,32 @@ private void process(final FetchCommittedOffsetsEvent
event) {
}
/**
- * Commit all consumed if auto-commit is enabled. Note this will trigger
an async commit,
- * that will not be retried if the commit request fails.
+ * Commit all consumed if auto-commit is enabled, then update the
assignment.
+ * The event future is completed only after the commit completes, ensuring
+ * assign() blocks until offsets are durably committed.
*/
private void process(final AssignmentChangeEvent event) {
+ CompletableFuture<Void> commitFuture = null;
if (requestManagers.commitRequestManager.isPresent()) {
CommitRequestManager manager =
requestManagers.commitRequestManager.get();
- manager.updateTimerAndMaybeCommit(event.currentTimeMs());
+ commitFuture =
manager.maybeAutoCommitSyncBeforeRebalance(event.deadlineMs());
Review Comment:
After private discussion with @chia7712 , we decide that this PR focused on
fixing bugs without modifying expected behavior, and if we need more
sophisticated retry logic, should fire a new KIP.
--
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]