yiguolei commented on code in PR #23142: URL: https://github.com/apache/doris/pull/23142#discussion_r1299148884
########## be/src/pipeline/pipeline_fragment_context.cpp: ########## @@ -824,11 +750,23 @@ Status PipelineFragmentContext::_create_sink(int sender_id, const TDataSink& thr } void PipelineFragmentContext::_close_action() { - _runtime_profile->total_time_counter()->update(_fragment_watcher.elapsed_time()); - send_report(true); - _stop_report_thread(); + auto close_time = _fragment_watcher.elapsed_time(); + _runtime_profile->total_time_counter()->update(close_time); + COUNTER_UPDATE(_close_timer, close_time); // all submitted tasks done - _exec_env->fragment_mgr()->remove_pipeline_context(shared_from_this()); + _exec_env->send_report_thread_pool()->submit_func([&, this] { Review Comment: It is very dangerous because if close_action returns then other code may release the plan or clean object pool or delete some objects. It will core in the async thread. -- 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