coltmcnealy-lh commented on code in PR #20833:
URL: https://github.com/apache/kafka/pull/20833#discussion_r2506268040


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -1458,6 +1458,14 @@ protected boolean maybeUpdateSubscriptionVersion(final 
int receivedAssignmentMet
 
     @Override
     public void onAssignment(final Assignment assignment, final 
ConsumerGroupMetadata metadata) {
+        final Set<Task> tasksWithOpenTransactions = taskManager.allOwnedTasks()
+            .values()
+            .stream()
+            .filter(t -> t.commitNeeded())
+            .collect(Collectors.toSet());
+        log.info("Committing {} tasks with open transactions before 
onAssignment()", tasksWithOpenTransactions.size());
+        taskManager.commit(tasksWithOpenTransactions);

Review Comment:
   Hmm. I thought the exceptions propagate up to the `poll()` method, which is 
handled inside the `StreamThread`? Or does this blow up and mess up the 
rebalance handling?



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/StreamsPartitionAssignor.java:
##########
@@ -1458,6 +1458,14 @@ protected boolean maybeUpdateSubscriptionVersion(final 
int receivedAssignmentMet
 
     @Override
     public void onAssignment(final Assignment assignment, final 
ConsumerGroupMetadata metadata) {
+        final Set<Task> tasksWithOpenTransactions = taskManager.allOwnedTasks()

Review Comment:
   Ah. Good point, no need to commit in ALOS. 



-- 
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