You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2023/06/13 00:50:45 UTC
[doris] branch master updated: [Bug](pipeline) fix memory leak because pipeline shared ptr not release #20710
This is an automated email from the ASF dual-hosted git repository.
yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/master by this push:
new 5e3a96d605 [Bug](pipeline) fix memory leak because pipeline shared ptr not release #20710
5e3a96d605 is described below
commit 5e3a96d6053b5638817f6356f52469b2ff1cb0f5
Author: Pxl <px...@qq.com>
AuthorDate: Tue Jun 13 08:50:34 2023 +0800
[Bug](pipeline) fix memory leak because pipeline shared ptr not release #20710
---
be/src/pipeline/pipeline.h | 4 ++--
be/src/pipeline/pipeline_task.h | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/be/src/pipeline/pipeline.h b/be/src/pipeline/pipeline.h
index 4cf9b53086..676eb9efa1 100644
--- a/be/src/pipeline/pipeline.h
+++ b/be/src/pipeline/pipeline.h
@@ -57,7 +57,7 @@ public:
}
void add_dependency(std::shared_ptr<Pipeline>& pipeline) {
- pipeline->_parents.push_back(shared_from_this());
+ pipeline->_parents.push_back(weak_from_this());
_dependencies.push_back(pipeline);
}
@@ -93,7 +93,7 @@ private:
OperatorBuilders _operator_builders; // left is _source, right is _root
OperatorBuilderPtr _sink; // put block to sink
- std::vector<std::shared_ptr<Pipeline>> _parents;
+ std::vector<std::weak_ptr<Pipeline>> _parents;
std::vector<std::shared_ptr<Pipeline>> _dependencies;
PipelineId _pipeline_id;
diff --git a/be/src/pipeline/pipeline_task.h b/be/src/pipeline/pipeline_task.h
index 5039b36bb4..dbf42157de 100644
--- a/be/src/pipeline/pipeline_task.h
+++ b/be/src/pipeline/pipeline_task.h
@@ -165,7 +165,7 @@ public:
void finish_p_dependency() {
for (const auto& p : _pipeline->_parents) {
- p->finish_one_dependency(_previous_schedule_id);
+ p.lock()->finish_one_dependency(_previous_schedule_id);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org