yiguolei commented on code in PR #54486:
URL: https://github.com/apache/doris/pull/54486#discussion_r2281412905
##########
be/src/vec/sink/writer/async_result_writer.cpp:
##########
@@ -64,12 +69,32 @@ Status AsyncResultWriter::sink(Block* block, bool eos) {
_dependency->block();
}
}
+
// in 'process block' we check _eos first and _data_queue second so here
// in the lock. must modify the _eos after change _data_queue to make sure
// not lead the logic error in multi thread
_eos = eos;
+ if (!_thread_submitted) {
+ // Need to start a new thread
+ _promise = std::make_shared<std::promise<Status>>();
+ *_future = _promise->get_future();
+ DCHECK(_operator_profile);
+ _thread_submitted = true;
+ _thread_quit_point = 0;
+ auto task_ctx = state->get_task_execution_context();
+
RETURN_IF_ERROR(ExecEnv::GetInstance()->fragment_mgr()->get_thread_pool()->submit_func(
+ [this, state, operator_profile = _operator_profile, task_ctx,
+ p = std::move(_promise)]() {
+ SCOPED_ATTACH_TASK(state);
Review Comment:
这个state 是一个raw ptr,在88 行运行的时候,state 可能被析构了
--
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]