yiguolei commented on code in PR #42053: URL: https://github.com/apache/doris/pull/42053#discussion_r1808115541
########## be/src/olap/delta_writer.cpp: ########## @@ -103,10 +103,18 @@ Status BaseDeltaWriter::init() { if (_is_init) { return Status::OK(); } + ThreadPool* flush_thread_pool_ptr = nullptr; + auto* t_ctx = doris::thread_context(true); + if (t_ctx) { + _wg_sptr = t_ctx->workload_group().lock(); + if (_wg_sptr) { + flush_thread_pool_ptr = _wg_sptr->get_memtable_flush_pool_ptr(); + } + } RETURN_IF_ERROR(_rowset_builder->init()); RETURN_IF_ERROR(_memtable_writer->init( _rowset_builder->rowset_writer(), _rowset_builder->tablet_schema(), - _rowset_builder->get_partial_update_info(), nullptr, + _rowset_builder->get_partial_update_info(), flush_thread_pool_ptr, Review Comment: 这里不要传递thread pool的raw ptr,直接把workload group的weak ptr 传递吧。 每次submit task的时候,都lock 一下wg的weak ptr,然后获得thread pool,然后submit。 -- 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