lucasbru commented on code in PR #21365:
URL: https://github.com/apache/kafka/pull/21365#discussion_r2759245575


##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/Tasks.java:
##########


Review Comment:
   See other comment.



##########
streams/src/main/java/org/apache/kafka/streams/processor/internals/Tasks.java:
##########
@@ -193,7 +193,9 @@ public synchronized void removeTask(final Task 
taskToRemove) {
             throw new IllegalStateException("Attempted to remove a task that 
is not closed or suspended: " + taskId);
         }
 
-        if (taskToRemove.isActive()) {
+        if (pendingTasksToInit.contains(taskToRemove)) {

Review Comment:
   The standby tasks should indeed by in CREATED in that collection. Sounds 
like a useful invariant to have, maybe we can even add a check in 
`addPendingTasksToInit` ?
   
   Using drainPendingTasksToInit sounds like a good idea to me. Not sure if 
there are any complications though, but it would seem cleaner code wise.



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