-
Notifications
You must be signed in to change notification settings - Fork 3.9k
[fix](pipeline) Prevent finalized tasks from being rescheduled #66385
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
base: branch-2.1
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -264,16 +264,23 @@ void _close_task(PipelineTask* task, PipelineTaskState state, Status exec_status | |
| void TaskScheduler::_do_work(size_t index) { | ||
| const auto& marker = _markers[index]; | ||
| while (*marker) { | ||
| auto* task = _task_queue->take(index); | ||
| if (!task) { | ||
| auto task_holder = _task_queue->take(index); | ||
| if (!task_holder) { | ||
| continue; | ||
| } | ||
| if (task->is_pipelineX() && task->is_running()) { | ||
| auto* task = task_holder.get(); | ||
| if (task->is_pipelineX() && task->set_running(true)) { | ||
| static_cast<void>(_task_queue->push_back(task, index)); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [P1] Do not recycle a wake token across task-state epochs Requeuing the losing entry preserves it without tying it to the dependency epoch that created it. A delayed duplicate can sit in the queue while the owner runs; if the owner then reaches EOS, |
||
| continue; | ||
| } | ||
| if (task->is_finished()) { | ||
| task->set_running(false); | ||
| continue; | ||
| } | ||
| task->log_detail_if_need(); | ||
| task->set_running(true); | ||
| if (!task->is_pipelineX()) { | ||
| task->set_running(true); | ||
| } | ||
| task->set_task_queue(_task_queue.get()); | ||
| auto* fragment_ctx = task->fragment_context(); | ||
| bool canceled = fragment_ctx->is_canceled(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[P2] Claim or coalesce duplicates before touching task accounting
The atomic claim happens only after
take()has updated this task's_queue_level/_core_idand stopped its wait-worker watcher. When this branch loses, it immediately pushes the same token again, so an idle worker can hot-loop pop/push for the owner's full execution slice (or longer close) whilepush()reads_runtime, increments_schedule_time, and restarts the same plain stopwatch. Meanwhile the owner callsupdate_statistics(), which writes_runtimeand reads_core_id/_queue_level; per-core queue locks do not synchronize these task fields, especially after steals. This leaves C++ data races plus corrupted priority/profile accounting even thoughexecute()is serialized. Please claim/coalesce before per-task dequeue accounting and add a latched multi-worker duplicate test.