wangbo commented on code in PR #50817:
URL: https://github.com/apache/doris/pull/50817#discussion_r2115466693
##########
be/src/runtime/query_context.cpp:
##########
@@ -381,20 +381,27 @@ void QueryContext::set_pipeline_context(
}
doris::pipeline::TaskScheduler* QueryContext::get_pipe_exec_scheduler() {
- if (workload_group()) {
- if (_task_scheduler) {
- return _task_scheduler;
- }
+ if (!_task_scheduler) {
+ throw Exception(Status::InternalError("task_scheduler is null"));
}
- return _exec_env->pipeline_task_scheduler();
+ return _task_scheduler;
}
-void QueryContext::set_workload_group(WorkloadGroupPtr& wg) {
- _resource_ctx->set_workload_group(wg);
- // Should add query first, then the workload group will not be deleted.
+Status QueryContext::set_workload_group(WorkloadGroupPtr& wg) {
+ // resource_ctx use dummmy wg as default wg.
+ // if user specify a wg, then set it in resource_ctx.
+ if (wg) {
+ _resource_ctx->set_workload_group(wg);
+ }
+
+ // Should add query first, the workload group will not be deleted,
+ // then visit workload group's resource
// see task_group_manager::delete_workload_group_by_ids
+ RETURN_IF_ERROR(workload_group()->add_resource_ctx(_query_id,
_resource_ctx));
+
workload_group()->get_query_scheduler(&_task_scheduler,
&_scan_task_scheduler,
Review Comment:
dummy的taskscheduler的初始化是在be的exeenv ready之后,应该只有be ready之后才可以接收查询,所以没有你说的问题。
--
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]