Copilot commented on code in PR #24140:
URL: https://github.com/apache/kafka/pull/24140#discussion_r4507885754
##########
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:
If a key is cancelled and rescheduled with the same `TaskRunnable` instance
but a different completion operation before `poll()`, this removal succeeds for
the cancelled queue entry. The old operation executes and the replacement is
skipped because its map entry has already been removed. Store and compare the
unique `ExecutorTask` wrapper instead, and add a regression test that reuses a
runnable after cancellation.
--
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]