guozhangwang commented on a change in pull request #8833:
URL: https://github.com/apache/kafka/pull/8833#discussion_r439093372



##########
File path: 
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java
##########
@@ -210,9 +214,8 @@ public void handleAssignment(final Map<TaskId, 
Set<TopicPartition>> activeTasks,
                 tasksToRecycle.add(task);
             } else {
                 try {
-                    task.prepareCloseClean();
-                    final Map<TopicPartition, OffsetAndMetadata> 
committableOffsets = task
-                        .committableOffsetsAndMetadata();
+                    task.suspend();

Review comment:
       We may not call `handleRevocation` before calling `handleAssignment` so 
the task to close may not be in SUSPENDED state yet, and hence do close them we 
need to commit their states. For other tasks, they are not necessarily 
committing but I think the point was, that since we are going to send one 
`commit` request anyways so just commit for everyone --- note that flushing can 
indeed be skipped, which is what KAFKA-9450 covers




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

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


Reply via email to