apache / incubator-pegasus

Apache Pegasus - A horizontally scalable, strongly consistent and high-performance key-value store
https://pegasus.apache.org/
Apache License 2.0
1.96k stars 310 forks source link

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

Open Sunflower876 opened 3 weeks ago

Sunflower876 commented 3 weeks ago

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