yiguolei commented on code in PR #49753: URL: https://github.com/apache/doris/pull/49753#discussion_r2024024901
########## be/src/pipeline/pipeline_task.h: ########## @@ -62,7 +63,7 @@ class PipelineTask { // must be call after all pipeline task is finish to release resource Status close(Status exec_status, bool close_sink = true); - PipelineFragmentContext* fragment_context() { return _fragment_context; } + std::shared_ptr<PipelineFragmentContext> fragment_context() { return _fragment_context.lock(); } Review Comment: 最好不要这么写。 这个写法,就得外部的调用者去判断是否是nullptr,而且如果他忘记了判断nullptr,线上就是一个core。 直接返回weak ptr,这样,外部调用者得显示的lock,就能感知到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: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org