github-actions[bot] commented on code in PR #26879:
URL: https://github.com/apache/doris/pull/26879#discussion_r1393645774
##########
be/src/pipeline/pipeline_x/dependency.cpp:
##########
@@ -21,10 +21,133 @@
#include <mutex>
#include "common/logging.h"
+#include "pipeline/pipeline_task.h"
+#include "pipeline/pipeline_x/pipeline_x_task.h"
#include "runtime/memory/mem_tracker.h"
namespace doris::pipeline {
+void Dependency::add_block_task(PipelineXTask* task) {
+ // TODO(gabriel): support read dependency
+ if (!_blocked_task.empty() && _blocked_task[_blocked_task.size() - 1] ==
task) {
+ return;
+ }
+ task->set_state(PipelineTaskState::BLOCKED_FOR_SOURCE);
+ _blocked_task.push_back(task);
+}
+
+void WriteDependency::add_write_block_task(PipelineXTask* task) {
Review Comment:
warning: method 'add_write_block_task' can be made static
[readability-convert-member-functions-to-static]
be/src/pipeline/pipeline_x/dependency.h:159:
```diff
- void add_write_block_task(PipelineXTask* task);
+ static void add_write_block_task(PipelineXTask* task);
```
##########
be/src/pipeline/pipeline_x/dependency.h:
##########
@@ -186,31 +186,32 @@ class FinishDependency final : public Dependency {
return _finish_dependency_watcher.elapsed_time();
}
- [[nodiscard]] FinishDependency* finish_blocked_by() {
+ [[nodiscard]] FinishDependency* finish_blocked_by(PipelineXTask* task) {
+ std::unique_lock<std::mutex> lc(_task_lock);
if (config::enable_fuzzy_mode && !_ready_to_finish &&
_should_log(_finish_dependency_watcher.elapsed_time())) {
LOG(WARNING) << "========Dependency may be blocked by some
reasons: " << name() << " "
- << _node_id;
+ << _node_id << " block tasks: " <<
_blocked_task.size();
}
- return _ready_to_finish ? nullptr : this;
- }
-
- void set_ready_to_finish() {
- if (_ready_to_finish) {
- return;
+ if (!_ready_to_finish && task) {
+ add_block_task(task);
}
- _finish_dependency_watcher.stop();
- _ready_to_finish = true;
+ return _ready_to_finish ? nullptr : this;
}
- void block_finishing() { _ready_to_finish = false; }
+ void set_ready_to_finish();
void* shared_state() override { return nullptr; }
+ std::string debug_string(int indentation_level = 0) override;
+
+ void add_block_task(PipelineXTask* task) override;
protected:
- std::atomic<bool> _ready_to_finish;
+ bool _ready_to_finish;
Review Comment:
warning: use default member initializer for '_ready_to_finish'
[modernize-use-default-member-init]
be/src/pipeline/pipeline_x/dependency.h:173:
```diff
- : Dependency(id, node_id, name), _ready_to_finish(true) {}
+ : Dependency(id, node_id, name), {}
```
```suggestion
bool _ready_to_finish{true};
```
##########
be/src/pipeline/pipeline_x/dependency.cpp:
##########
@@ -294,6 +440,12 @@
return results;
}
+void SetSharedState::set_probe_finished_children(int child_id) {
Review Comment:
warning: method 'set_probe_finished_children' can be made static
[readability-convert-member-functions-to-static]
be/src/pipeline/pipeline_x/dependency.h:785:
```diff
- void set_probe_finished_children(int child_id);
+ static void set_probe_finished_children(int child_id);
```
--
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]