Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(task_tracker): cancel_outstanding_tasks can't cancel all tracked tasks. #2043

Open
Sunflower876 opened this issue Jun 5, 2024 · 0 comments
Labels
type/bug This issue reports a bug.

Comments

@Sunflower876
Copy link
Contributor

Sunflower876 commented Jun 5, 2024

Bug Report

The following is the implement of task_tracker::cancel_outstanding_tasks.

In the for loop, if i iterates to 2, take out the task of the second bucket queue head, which corresponds to task2 of the _outstanding_tasks[2]. next, and find that the status of task2 is running, and then execute task2->cancel (true). We will synchronize and wait for task2 to finish executing. The subsequent execution of task2 will generate a new task1, which corresponds to the same tracker as task2, but the bucket corresponding to task1 is 1. Because the for loop has already been executed to i=2, we will not go back to check for i=1, resulting in task1 tracked by the same tracker still being executed even after canel_standing_tasks have been executed.

image

@Sunflower876 Sunflower876 added the type/bug This issue reports a bug. label Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug This issue reports a bug.
Projects
None yet
Development

No branches or pull requests

1 participant