squah-confluent commented on code in PR #24140:
URL: https://github.com/apache/kafka/pull/24140#discussion_r4507966433


##########
coordinator-common/src/testFixtures/java/org/apache/kafka/coordinator/common/runtime/MockCoordinatorExecutor.java:
##########
@@ -97,7 +97,7 @@ public void cancel(String key) {
     public List<ExecutorResult<T>> poll() {
         List<ExecutorResult<T>> results = new ArrayList<>();
         for (ExecutorTask<?> task : queue) {
-            tasks.remove(task.key, task.task);
+            if (!tasks.remove(task.key, task.task)) continue;

Review Comment:
   Good catch. `CoordinatorExecutorImpl` identifies each scheduled task by a 
per-`schedule()` `Task` wrapper rather than by the `TaskRunnable` since 
KAFKA-21196 ([tasks 
map](https://github.com/apache/kafka/blob/8f4cc1d80036105ffc79388dc659a9b325996943/coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorExecutorImpl.java#L177),
 [wrapper created per 
schedule](https://github.com/apache/kafka/blob/8f4cc1d80036105ffc79388dc659a9b325996943/coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorExecutorImpl.java#L206),
 [run 
check](https://github.com/apache/kafka/blob/8f4cc1d80036105ffc79388dc659a9b325996943/coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorExecutorImpl.java#L67),
 [complete 
check](https://github.com/apache/kafka/blob/8f4cc1d80036105ffc79388dc659a9b325996943/coordinator-common/src/main/java/org/apache/kafka/coordinator/common/runtime/CoordinatorExecutorImpl.java#L112)).
 
 Updated the mock to do the same in bad6855216: it now stores and compares its 
`ExecutorTask` wrapper.
   
   — Claude



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