yiguolei commented on code in PR #56755:
URL: https://github.com/apache/doris/pull/56755#discussion_r2428702747
##########
be/src/pipeline/dependency.h:
##########
@@ -131,6 +132,19 @@ class Dependency : public
std::enable_shared_from_this<Dependency> {
_shared_state->sink_deps.front()->set_ready();
}
+ void remove_blocked_task(const std::shared_ptr<PipelineTask>& task) {
+ std::unique_lock<std::mutex> lc(_task_lock);
+ auto it = std::ranges::find_if(_blocked_task, [&](const
std::weak_ptr<PipelineTask>& ptr) {
+ auto sp = ptr.lock();
+ return sp == task;
+ });
+
+ if (it == _blocked_task.end()) {
+ return;
+ }
+ _blocked_task.erase(it);
Review Comment:
直接在这里调用pipeline task的api,去更新pipeline task的block dep吧,不要再外面改了。
因为我们设置pipeline task的block dep 也是在这个_task_lock 里完成的。
Status blocked(Dependency* dependency, std::unique_lock<std::mutex>& /*
dep_lock */) {
DCHECK_EQ(_blocked_dep, nullptr) << "task: " << debug_string();
_blocked_dep = dependency;
return _state_transition(PipelineTask::State::BLOCKED);
}
把这个代码改改,这样都在一个lock 里完成比较保险
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]