HappenLee commented on code in PR #48168:
URL: https://github.com/apache/doris/pull/48168#discussion_r1964809750
##########
be/src/pipeline/task_scheduler.cpp:
##########
@@ -114,10 +111,20 @@ void TaskScheduler::_do_work(int index) {
}
task->log_detail_if_need();
task->set_running(true);
- bool fragment_is_finished = false;
+ bool eos = false;
+ auto status = Status::OK();
Defer task_running_defer {[&]() {
// If fragment is finished, fragment context will be
de-constructed with all tasks in it.
- if (!fragment_is_finished) {
+ if (eos || !status.ok()) {
+ // decrement_running_task may delete fragment context and will
core in some defer
+ // code, because the defer code will access fragment context
itself.
+ auto lock_for_context =
task->fragment_context()->shared_from_this();
+ bool close = close_task(task, status);
+ task->set_running(false);
+ if (close) {
+
task->fragment_context()->decrement_running_task(task->pipeline_id());
+ }
+ } else {
Review Comment:
seens not need else, should alway set `task->set_running(false);`
--
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]