guozhangwang commented on code in PR #12520:
URL: https://github.com/apache/kafka/pull/12520#discussion_r946996425


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:
##########
@@ -838,6 +838,21 @@ void handleRevocation(final Collection<TopicPartition> 
revokedPartitions) {
         if (firstException.get() != null) {
             throw firstException.get();
         }
+
+        removeRevokedTasksFromStateUpdater(remainingRevokedPartitions);

Review Comment:
   I think it's better to call this function before line 758



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/TaskManager.java:
##########
@@ -838,6 +838,21 @@ void handleRevocation(final Collection<TopicPartition> 
revokedPartitions) {
         if (firstException.get() != null) {
             throw firstException.get();
         }
+
+        removeRevokedTasksFromStateUpdater(remainingRevokedPartitions);
+    }
+
+    private void removeRevokedTasksFromStateUpdater(final Set<TopicPartition> 
remainingRevokedPartitions) {
+        if (stateUpdater != null) {
+            for (final Task restoringTask : stateUpdater.getTasks()) {
+                if (restoringTask.isActive()) {
+                    if 
(remainingRevokedPartitions.containsAll(restoringTask.inputPartitions())) {

Review Comment:
   Should we also remove those partitions from the `remainingRevokedPartitions` 
as well?



-- 
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: jira-unsubscr...@kafka.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to